# HG changeset patch # User reimar # Date 1258895679 0 # Node ID 9e76a5f9e71719c97cebe81a26d74b162365050d # Parent 49f3853e910508c1c336739794857efd0c7689f4 Switch ad_ffmpeg to avcodec_decode_audio3 diff -r 49f3853e9105 -r 9e76a5f9e717 libmpcodecs/ad_ffmpeg.c --- a/libmpcodecs/ad_ffmpeg.c Sun Nov 22 13:08:43 2009 +0000 +++ b/libmpcodecs/ad_ffmpeg.c Sun Nov 22 13:14:39 2009 +0000 @@ -163,15 +163,19 @@ unsigned char *start=NULL; int y,len=-1; while(lends,&start, &pts); if(x<=0) break; // error + av_init_packet(&pkt); + pkt.data = start; + pkt.size = x; if (pts != MP_NOPTS_VALUE) { sh_audio->pts = pts; sh_audio->pts_bytes = 0; } - y=avcodec_decode_audio2(sh_audio->context,(int16_t*)buf,&len2,start,x); + y=avcodec_decode_audio3(sh_audio->context,(int16_t*)buf,&len2,&pkt); //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!)