changeset 29568:ccb7b7f4b764

Hack demux_demuxers so that demux_demuxers_fill_buffer is actually called.
author reimar
date Tue, 01 Sep 2009 14:51:49 +0000
parents 349de9bdfcce
children 3e13839031b3
files libmpdemux/demux_demuxers.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_demuxers.c	Tue Sep 01 12:12:45 2009 +0000
+++ b/libmpdemux/demux_demuxers.c	Tue Sep 01 14:51:49 2009 +0000
@@ -54,6 +54,9 @@
   ret->video = vd->video;
   ret->audio = ad->audio;
   ret->sub = sd->sub;
+  if (vd) vd->video->demuxer = ret;
+  if (ad) ad->audio->demuxer = ret;
+  if (sd) sd->sub->demuxer = ret;
 
   // HACK?, necessary for subtitle (and audio and video when implemented) switching
   memcpy(ret->v_streams, vd->v_streams, sizeof(ret->v_streams));
@@ -70,11 +73,11 @@
 
   priv=demux->priv;
 
-  if(ds->demuxer == priv->vd)
+  if(priv->vd && priv->vd->video == ds)
     return demux_fill_buffer(priv->vd,ds);
-  else if(ds->demuxer == priv->ad)
+  else if(priv->ad && priv->ad->audio == ds)
     return demux_fill_buffer(priv->ad,ds);
-  else if(ds->demuxer == priv->sd)
+  else if(priv->sd && priv->sd->sub == ds)
     return demux_fill_buffer(priv->sd,ds);
 
   mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_MPDEMUX_DEMUXERS_FillBufferError);