diff libmpdemux/demuxer.c @ 19540:70a5e89ea4cd

Get rid of demux_aid_vid_mismatch mess.
author reimar
date Sat, 26 Aug 2006 19:17:04 +0000
parents 8dd04ec733f5
children b251bca5820c
line wrap: on
line diff
--- a/libmpdemux/demuxer.c	Sat Aug 26 19:00:21 2006 +0000
+++ b/libmpdemux/demuxer.c	Sat Aug 26 19:17:04 2006 +0000
@@ -126,10 +126,6 @@
   NULL
 };
 
-// Should be set to 1 by demux module if ids it passes to new_sh_audio and
-// new_sh_video don't match aids and vids it accepts from the command line
-int demux_aid_vid_mismatch = 0;
-
 void free_demuxer_stream(demux_stream_t *ds){
     ds_free_packs(ds);
     free(ds);
@@ -203,7 +199,7 @@
   return d;
 }
 
-sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id){
+sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid){
     if(id > MAX_A_STREAMS-1 || id < 0)
     {
 	mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested audio stream id overflow (%d > %d)\n",
@@ -223,9 +219,9 @@
         sh->sample_format=AF_FORMAT_S16_NE;
         sh->audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/
         sh->pts=MP_NOPTS_VALUE;
-        if (!demux_aid_vid_mismatch)
-          mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_ID=%d\n", id);
+          mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_ID=%d\n", aid);
     }
+    ((sh_audio_t *)demuxer->a_streams[id])->aid = aid;
     return demuxer->a_streams[id];
 }
 
@@ -237,7 +233,7 @@
     free(sh);
 }
 
-sh_video_t* new_sh_video(demuxer_t *demuxer,int id){
+sh_video_t* new_sh_video_vid(demuxer_t *demuxer,int id,int vid){
     if(id > MAX_V_STREAMS-1 || id < 0)
     {
 	mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested video stream id overflow (%d > %d)\n",
@@ -250,9 +246,9 @@
         mp_msg(MSGT_DEMUXER,MSGL_V,MSGTR_FoundVideoStream,id);
         demuxer->v_streams[id]=malloc(sizeof(sh_video_t));
         memset(demuxer->v_streams[id],0,sizeof(sh_video_t));
-        if (!demux_aid_vid_mismatch)
-          mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_ID=%d\n", id);
+          mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_ID=%d\n", vid);
     }
+    ((sh_video_t *)demuxer->v_streams[id])->vid = vid;
     return demuxer->v_streams[id];
 }
 
@@ -814,8 +810,6 @@
   int demuxer_force = 0, audio_demuxer_force = 0,
       sub_demuxer_force = 0;
 
-  demux_aid_vid_mismatch = 0;
-
   if ((demuxer_type = get_demuxer_type_from_name(demuxer_name, &demuxer_force)) < 0) {
     mp_msg(MSGT_DEMUXER,MSGL_ERR,"-demuxer %s does not exist.\n",demuxer_name);
   }