[MPlayer-dev-eng] [PATCH] try to actually open demuxer in test

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Oct 20 18:59:57 CEST 2006


Hello,
On Fri, Oct 20, 2006 at 08:18:34PM +0400, Evgeniy Stepanov wrote:
> On Thursday 19 October 2006 22:22, Reimar Döffinger wrote:
> > On Sat, Oct 14, 2006 at 11:42:33PM +0200, Reimar D?ffinger wrote:
> > > the attached patch makes the demuxer open function actually try to open
> > > the file with a demuxer it detected and continue with others if it
> > > fails.
> > > This makes the dv-in-avi samples (at least
> > > http://samples.mplayerhq.hu/avi/DV-hdr/foo001.avi) work out of the box
> > > by falling back to libavformat demuxing.
> > > Please test and check for stupid errors, that code somehow made my head
> > > spin.
> >
> > Applied.
> 
> As I mentioned in -cvslog, it breaks tv:// playerback. This happens because tv 
> demuxer does not have check_file() function. After your change open() is 
> never called for such demuxers.

Thanks for finding the reason, I can't test V4L.

> I suggest this simple fix. Please review it carefully, I'm not sure this does 
> not break something else.

At least in the past some demuxers failed (even crashed) if open was
called without check_file first.
Thus I would suggest the attached patch.
Can you please test/comment?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/demuxer.c
===================================================================
--- libmpdemux/demuxer.c	(revision 20317)
+++ libmpdemux/demuxer.c	(working copy)
@@ -662,9 +662,9 @@
 if (file_format) {
   if ((demuxer_desc = get_demuxer_desc_from_type(file_format))) {
     demuxer = new_demuxer(stream,demuxer_desc->type,audio_id,video_id,dvdsub_id,filename);
-    if (demuxer_desc->check_file) {
+    if (demuxer_desc->check_file)
       fformat = demuxer_desc->check_file(demuxer);
-      if (force)
+      if (force || !demuxer_desc->check_file)
         fformat = demuxer_desc->type;
       if (fformat != 0) {
         if (fformat == demuxer_desc->type) {
@@ -686,7 +686,6 @@
         // Check failed for forced demuxer, quit
         free_demuxer(demuxer);
         return NULL;
-    }
   }
 }
 


More information about the MPlayer-dev-eng mailing list