mirror of
https://github.com/mpv-player/mpv
synced 2024-12-18 04:45:33 +00:00
always reser audio input buffer pointer
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6050 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
662a79ffb0
commit
afefdc4305
@ -160,7 +160,6 @@ static int control(sh_audio_t *sh,int cmd,void* arg, ...){
|
||||
// various optional functions you MAY implement:
|
||||
switch(cmd){
|
||||
case ADCTRL_RESYNC_STREAM:
|
||||
sh->a_in_buffer_len=0; // clear audio input buffer
|
||||
this->have_frame=0;
|
||||
mad_synth_init (&this->synth);
|
||||
mad_stream_init (&this->stream);
|
||||
|
@ -113,8 +113,7 @@ static int control(sh_audio_t *sh,int cmd,void* arg, ...){
|
||||
switch(cmd){
|
||||
case ADCTRL_RESYNC_STREAM:
|
||||
// it is called once after seeking, to resync.
|
||||
// if you don't return CONTROL_TRUE, it will defaults to:
|
||||
// sh_audio->a_in_buffer_len=0; // clear input buffer
|
||||
// Note: sh_audio->a_in_buffer_len=0; is done _before_ this call!
|
||||
...
|
||||
return CONTROL_TRUE;
|
||||
case ADCTRL_SKIP_FRAME:
|
||||
|
@ -134,10 +134,9 @@ int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
|
||||
|
||||
void resync_audio_stream(sh_audio_t *sh_audio)
|
||||
{
|
||||
if(!sh_audio->inited) return;
|
||||
if(mpadec->control(sh_audio,ADCTRL_RESYNC_STREAM,NULL)==CONTROL_TRUE) return;
|
||||
// default resync code:
|
||||
sh_audio->a_in_buffer_len=0; // clear audio input buffer
|
||||
if(!sh_audio->inited) return;
|
||||
mpadec->control(sh_audio,ADCTRL_RESYNC_STREAM,NULL);
|
||||
}
|
||||
|
||||
void skip_audio_frame(sh_audio_t *sh_audio)
|
||||
|
Loading…
Reference in New Issue
Block a user