summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/ad_ffmpeg.c
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-02-18 15:23:41 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-02-18 15:23:41 +0000
commit14c5a7c333253a479c42760f7d86d698989fddd9 (patch)
tree0133827c89da2f5f51b438513f99358831fe0e92 /libmpcodecs/ad_ffmpeg.c
parent6f0edb45743d6f324b11fc89b58869f97a21b777 (diff)
downloadmpv-14c5a7c333253a479c42760f7d86d698989fddd9.tar.bz2
mpv-14c5a7c333253a479c42760f7d86d698989fddd9.tar.xz
flushing stuff after seeking (finally we can view MPEG without thouse blocks after seeking with -vc ffmpeg12)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11978 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/ad_ffmpeg.c')
-rw-r--r--libmpcodecs/ad_ffmpeg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c
index 481026d38c..a4d894ad09 100644
--- a/libmpcodecs/ad_ffmpeg.c
+++ b/libmpcodecs/ad_ffmpeg.c
@@ -126,8 +126,13 @@ static void uninit(sh_audio_t *sh)
static int control(sh_audio_t *sh,int cmd,void* arg, ...)
{
- // TODO ???
- return CONTROL_UNKNOWN;
+ AVCodecContext *lavc_context = sh->context;
+ switch(cmd){
+ case ADCTRL_RESYNC_STREAM:
+ avcodec_flush_buffers(lavc_context);
+ return CONTROL_TRUE;
+ }
+ return CONTROL_UNKNOWN;
}
static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
@@ -139,6 +144,7 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m
int x=ds_get_packet(sh_audio->ds,&start);
if(x<=0) break; // error
y=avcodec_decode_audio(sh_audio->context,(INT16*)buf,&len2,start,x);
+//printf("return:%d samples_out:%d bitstream_in:%d sample_sum:%d\n", y, len2, x, len); fflush(stdout);
if(y<0){ mp_msg(MSGT_DECAUDIO,MSGL_V,"lavc_audio: error\n");break; }
if(y<x) sh_audio->ds->buffer_pos+=y-x; // put back data (HACK!)
if(len2>0){