[MPlayer-cvslog] r26907 - trunk/libmpdemux/demuxer.c

reimar subversion at mplayerhq.hu
Tue May 27 19:33:14 CEST 2008


Author: reimar
Date: Tue May 27 19:33:13 2008
New Revision: 26907

Log:
Simplify/make new_sh behaviour more consistent when a stream gets redefined.


Modified:
   trunk/libmpdemux/demuxer.c

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Tue May 27 19:33:13 2008
@@ -268,6 +268,7 @@ sh_audio_t* new_sh_audio_aid(demuxer_t *
         sh_audio_t *sh = calloc(1, sizeof(sh_audio_t));
         mp_msg(MSGT_DEMUXER,MSGL_V,MSGTR_FoundAudioStream,id);
         demuxer->a_streams[id] = sh;
+        sh->aid = aid;
         // set some defaults
         sh->samplesize=2;
         sh->sample_format=AF_FORMAT_S16_NE;
@@ -275,7 +276,6 @@ sh_audio_t* new_sh_audio_aid(demuxer_t *
         sh->pts=MP_NOPTS_VALUE;
           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];
 }
 
@@ -299,11 +299,12 @@ sh_video_t* new_sh_video_vid(demuxer_t *
     if(demuxer->v_streams[id]){
         mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_VideoStreamRedefined,id);
     } else {
+        sh_video_t *sh = calloc(1, sizeof(sh_video_t));
         mp_msg(MSGT_DEMUXER,MSGL_V,MSGTR_FoundVideoStream,id);
-        demuxer->v_streams[id]=calloc(1, sizeof(sh_video_t));
+        demuxer->v_streams[id] = sh;
+        sh->vid = vid;
           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];
 }
 



More information about the MPlayer-cvslog mailing list