changeset 32493:59b6fef90241

Fix program switching with -demuxer lavf.
author reimar
date Sat, 06 Nov 2010 14:57:44 +0000
parents 5fc287bf541a
children 288e5d438772
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sat Nov 06 14:41:23 2010 +0000
+++ b/libmpdemux/demux_lavf.c	Sat Nov 06 14:57:44 2010 +0000
@@ -800,6 +800,18 @@
                         break;
                 }
             }
+            if (prog->aid >= 0 && prog->aid < MAX_A_STREAMS &&
+                demuxer->a_streams[prog->aid]) {
+                sh_audio_t *sh = demuxer->a_streams[prog->aid];
+                prog->aid = sh->aid;
+            } else
+                prog->aid = -2;
+            if (prog->vid >= 0 && prog->vid < MAX_V_STREAMS &&
+                demuxer->v_streams[prog->vid]) {
+                sh_video_t *sh = demuxer->v_streams[prog->vid];
+                prog->vid = sh->vid;
+            } else
+                prog->vid = -2;
             if(prog->progid == -1 && prog->vid == -2 && prog->aid == -2)
             {
                 p = (p + 1) % priv->avfc->nb_programs;