changeset 36800:f3c835ddce85

demuxers: ensure that stream ids are correctly initialized. This should fix missing video after r36778 and potentially other issues in relation with video stream switching.
author reimar
date Wed, 19 Feb 2014 23:01:15 +0000
parents b24236587d70
children 60a69c73d982
files libmpdemux/demux_film.c libmpdemux/demux_fli.c libmpdemux/demux_gif.c libmpdemux/demux_mf.c libmpdemux/demux_mng.c libmpdemux/demux_mpg.c libmpdemux/demux_nsv.c libmpdemux/demux_pva.c libmpdemux/demux_rawdv.c libmpdemux/demux_rawvideo.c libmpdemux/demux_roq.c libmpdemux/demux_rtp_codec.cpp libmpdemux/demux_smjpeg.c
diffstat 13 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_film.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_film.c	Wed Feb 19 23:01:15 2014 +0000
@@ -280,6 +280,7 @@
       {
         // create and initialize the video stream header
         sh_video = new_sh_video(demuxer, 0);
+        demuxer->video->id = 0;
         demuxer->video->sh = sh_video;
         sh_video->ds = demuxer->video;
 
@@ -345,6 +346,7 @@
 
         // create and initialize the audio stream header
         sh_audio = new_sh_audio(demuxer, 0, NULL);
+        demuxer->audio->id = 0;
         demuxer->audio->sh = sh_audio;
         sh_audio->ds = demuxer->audio;
 
--- a/libmpdemux/demux_fli.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_fli.c	Wed Feb 19 23:01:15 2014 +0000
@@ -128,6 +128,7 @@
 
   // make sure the demuxer knows about the new video stream header
   // (even though new_sh_video() ought to take care of it)
+  demuxer->video->id = 0;
   demuxer->video->sh = sh_video;
 
   // make sure that the video demuxer stream header knows about its
--- a/libmpdemux/demux_gif.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_gif.c	Wed Feb 19 23:01:15 2014 +0000
@@ -297,6 +297,7 @@
 
   // make sure the demuxer knows about the new video stream header
   // (even though new_sh_video() ought to take care of it)
+  demuxer->video->id = 0;
   demuxer->video->sh = sh_video;
 
   // make sure that the video demuxer stream header knows about its
--- a/libmpdemux/demux_mf.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_mf.c	Wed Feb 19 23:01:15 2014 +0000
@@ -147,6 +147,7 @@
   sh_video = new_sh_video(demuxer, 0);
   // make sure the demuxer knows about the new video stream header
   // (even though new_sh_video() ought to take care of it)
+  demuxer->video->id = 0;
   demuxer->video->sh = sh_video;
 
   // make sure that the video demuxer stream header knows about its
--- a/libmpdemux/demux_mng.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_mng.c	Wed Feb 19 23:01:15 2014 +0000
@@ -428,6 +428,7 @@
     // Make sure the demuxer knows about the new video stream header
     // (even though new_sh_video() ought to take care of it).
     // (Thanks to demux_gif.c for this.)
+    demuxer->video->id = 0;
     demuxer->video->sh = sh_video;
 
     // Make sure that the video demuxer stream header knows about its
--- a/libmpdemux/demux_mpg.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_mpg.c	Wed Feb 19 23:01:15 2014 +0000
@@ -1086,6 +1086,7 @@
 
     demuxer->audio->sh = NULL;   // ES streams has no audio channel
     demuxer->video->sh = new_sh_video(demuxer,0); // create dummy video stream header, id=0
+    demuxer->video->id = 0;
     sh_video=demuxer->video->sh;sh_video->ds=demuxer->video;
 
     return demuxer;
@@ -1094,6 +1095,7 @@
 static demuxer_t *demux_mpg_gxf_open(demuxer_t *demuxer) {
   demuxer->audio->sh = NULL;
   demuxer->video->sh = new_sh_video(demuxer,0);
+  demuxer->video->id = 0;
   ((sh_video_t *)demuxer->video->sh)->ds = demuxer->video;
   demuxer->priv = (void *) 0xffffffff;
   return demuxer;
--- a/libmpdemux/demux_nsv.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_nsv.c	Wed Feb 19 23:01:15 2014 +0000
@@ -214,6 +214,7 @@
             /* Make sure the demuxer knows about the new video stream header
              * (even though new_sh_video() ought to take care of it)
              */
+            demuxer->video->id = 0;
             demuxer->video->sh = sh_video;
 
             /* Make sure that the video demuxer stream header knows about its
--- a/libmpdemux/demux_pva.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_pva.c	Wed Feb 19 23:01:15 2014 +0000
@@ -156,6 +156,7 @@
 
 	//printf("priv->just_synced %s after initial sync!\n",priv->just_synced?"set":"UNSET");
 
+	demuxer->video->id = 0;
 	demuxer->video->sh=sh_video;
 
 	//printf("demuxer->stream->end_pos= %d\n",demuxer->stream->end_pos);
--- a/libmpdemux/demux_rawdv.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_rawdv.c	Wed Feb 19 23:01:15 2014 +0000
@@ -170,6 +170,7 @@
    // make sure the demuxer knows about the new video stream header
    // (even though new_sh_video() ought to take care of it)
    demuxer->seekable = 1;
+   demuxer->video->id = 0;
    demuxer->video->sh = sh_video;
 
    // make sure that the video demuxer stream header knows about its
--- a/libmpdemux/demux_rawvideo.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_rawvideo.c	Wed Feb 19 23:01:15 2014 +0000
@@ -119,6 +119,7 @@
   demuxer->movi_start = demuxer->stream->start_pos;
   demuxer->movi_end = demuxer->stream->end_pos;
 
+  demuxer->video->id = 0;
   demuxer->video->sh = sh_video;
   sh_video->ds = demuxer->video;
 
--- a/libmpdemux/demux_roq.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_roq.c	Wed Feb 19 23:01:15 2014 +0000
@@ -136,6 +136,7 @@
         // this is a good opportunity to create a video stream header
         sh_video = new_sh_video(demuxer, 0);
         // make sure the demuxer knows about the new stream header
+        demuxer->video->id = 0;
         demuxer->video->sh = sh_video;
         // make sure that the video demuxer stream header knows about its
         // parent video demuxer stream
--- a/libmpdemux/demux_rtp_codec.cpp	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_rtp_codec.cpp	Wed Feb 19 23:01:15 2014 +0000
@@ -114,6 +114,7 @@
   sh_video->bih = bih;
   demux_stream_t* d_video = demuxer->video;
   d_video->sh = sh_video; sh_video->ds = d_video;
+  d_video->id = 0;
 
   // Map known video MIME types to the BITMAPINFOHEADER parameters
   // that this program uses.  (Note that not all types need all
--- a/libmpdemux/demux_smjpeg.c	Wed Feb 19 23:01:13 2014 +0000
+++ b/libmpdemux/demux_smjpeg.c	Wed Feb 19 23:01:15 2014 +0000
@@ -126,6 +126,7 @@
 	{
 	case mmioFOURCC('_','V','I','D'):
 	    sh_video = new_sh_video(demuxer, 0);
+	    demuxer->video->id = 0;
 	    demuxer->video->sh = sh_video;
 	    sh_video->ds = demuxer->video;