changeset 35448:f4828b517f4a

Fix scary "BUG! Invalid demuxer type ..." message when using -audiofile or -subfile.
author reimar
date Fri, 30 Nov 2012 22:12:17 +0000
parents 825d6e1cad3e
children 07b1f01495ee
files libmpdemux/demux_demuxers.c libmpdemux/demuxer.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_demuxers.c	Fri Nov 30 21:31:14 2012 +0000
+++ b/libmpdemux/demux_demuxers.c	Fri Nov 30 22:12:17 2012 +0000
@@ -66,8 +66,6 @@
   memcpy(ret->a_streams, ad->a_streams, sizeof(ret->a_streams));
   memcpy(ret->s_streams, sd->s_streams, sizeof(ret->s_streams));
 
-  ret->desc = &demuxer_desc_demuxers;
-
   return ret;
 }
 
--- a/libmpdemux/demuxer.c	Fri Nov 30 21:31:14 2012 +0000
+++ b/libmpdemux/demuxer.c	Fri Nov 30 22:12:17 2012 +0000
@@ -108,6 +108,9 @@
 extern const demuxer_desc_t demuxer_desc_nut;
 extern const demuxer_desc_t demuxer_desc_mng;
 
+// never add this to the list
+extern const demuxer_desc_t demuxer_desc_demuxers;
+
 /* Please do not add any new demuxers here. If you want to implement a new
  * demuxer, add it to libavformat, except for wrappers around external
  * libraries and demuxers requiring binary support. */
@@ -214,6 +217,8 @@
 static const demuxer_desc_t *get_demuxer_desc_from_type(int file_format)
 {
     int i;
+    if (file_format == DEMUXER_TYPE_DEMUXERS)
+        return &demuxer_desc_demuxers;
 
     for (i = 0; demuxer_list[i]; i++)
         if (file_format == demuxer_list[i]->type)