diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-12 00:44:32 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-12 00:44:32 +0000 |
commit | afefdc43053db38e46f848c6810da0580f85dfd2 (patch) | |
tree | 766cfae2a8eecca244885df8bbbae85aed6c9676 /libmpcodecs | |
parent | 662a79ffb0df2e3a240cfd82e85985d0a8c2a67b (diff) | |
download | mpv-afefdc43053db38e46f848c6810da0580f85dfd2.tar.bz2 mpv-afefdc43053db38e46f848c6810da0580f85dfd2.tar.xz |
always reser audio input buffer pointer
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6050 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_libmad.c | 1 | ||||
-rw-r--r-- | libmpcodecs/ad_sample.c | 3 | ||||
-rw-r--r-- | libmpcodecs/dec_audio.c | 5 |
3 files changed, 3 insertions, 6 deletions
diff --git a/libmpcodecs/ad_libmad.c b/libmpcodecs/ad_libmad.c index 223c43f974..083a0942ad 100644 --- a/libmpcodecs/ad_libmad.c +++ b/libmpcodecs/ad_libmad.c @@ -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); diff --git a/libmpcodecs/ad_sample.c b/libmpcodecs/ad_sample.c index f20fbcbb92..56d5a46dea 100644 --- a/libmpcodecs/ad_sample.c +++ b/libmpcodecs/ad_sample.c @@ -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: diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c index 459a5b8c60..333c4d6c15 100644 --- a/libmpcodecs/dec_audio.c +++ b/libmpcodecs/dec_audio.c @@ -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) |