From ac87b4a173d2aee564e7cdca3037f101d946fbad Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 5 Jun 2007 14:12:37 +0000 Subject: Use avcodec_decode_audio2 in ad_ffmpeg.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23474 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_ffmpeg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libmpcodecs/ad_ffmpeg.c') diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 6e491e79c0..8731373511 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -150,7 +150,7 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m unsigned char *start=NULL; int y,len=-1; while(lends,&start, &pts); if(x<=0) break; // error @@ -158,7 +158,7 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m sh_audio->pts = pts; sh_audio->pts_bytes = 0; } - y=avcodec_decode_audio(sh_audio->context,(int16_t*)buf,&len2,start,x); + y=avcodec_decode_audio2(sh_audio->context,(int16_t*)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(yds->buffer_pos+=y-x; // put back data (HACK!) @@ -166,6 +166,7 @@ static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int m //len=len2;break; if(len<0) len=len2; else len+=len2; buf+=len2; + maxlen -= len2; sh_audio->pts_bytes += len2; } mp_dbg(MSGT_DECAUDIO,MSGL_DBG2,"Decoded %d -> %d \n",y,len2); -- cgit v1.2.3