[MPlayer-dev-eng] [PATCH] support for mid-way audio streams

Nico Sabbi nicola_sabbi at fastwebnet.it
Tue Jul 4 22:41:57 CEST 2006


Nico Sabbi wrote:

> Reimar Doeffinger wrote:
>
>>
>> Please don't remove the empty line before the "PLAY AUDIO" comment.
>>
>> Greetings,
>> Reimar Doeffinger
>>   
>
>
> ok.
> BTW, I forgot a fix: reinit_audio_chain() must set d_audio->id = -2 
> when it's not possible
> to init the chain, otherwise the demuxer will stack up undecoded audio 
> packets in demuxer->audio
>
>
committed the following:

Index: mplayer.c
===================================================================
--- mplayer.c   (revisione 18901)
+++ mplayer.c   (copia locale)
@@ -2345,6 +2345,7 @@
   
mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n");
   if(!init_best_audio_codec(sh_audio,audio_codec_list,audio_fm_list)){
     sh_audio=d_audio->sh=NULL; // failed to init :(
+    d_audio->id = -2;
     return;
   } else
     inited_flags|=INITED_ACODEC;
@@ -2378,6 +2379,7 @@
     mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CannotInitAO);
     uninit_player(INITED_ACODEC); // close codec
     sh_audio=d_audio->sh=NULL; // -> nosound
+    d_audio->id = -2;
     return;
   } else {
     // SUCCESS:
@@ -3611,7 +3613,7 @@
   mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_NoSound);
   mp_msg(MSGT_CPLAYER,MSGL_V,"Freeing %d unused audio 
chunks.\n",d_audio->packs);
   ds_free_packs(d_audio); // free buffered chunks
-  d_audio->id=-2;         // do not read audio chunks
+  //d_audio->id=-2;         // do not read audio chunks
   //uninit_player(INITED_AO); // close device
 }
 if(!sh_video){
@@ -3650,6 +3652,11 @@

 while(!eof){
     float aq_sleep_time=0;
+if(!sh_audio && d_audio->sh) {
+  sh_audio = d_audio->sh;
+  sh_audio->ds = d_audio;
+  reinit_audio_chain();
+}

 /*========================== PLAY AUDIO ============================*/





More information about the MPlayer-dev-eng mailing list