[MPlayer-dev-eng] [PATCH] use avcodec_decode_audio2
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Mar 19 19:32:55 CET 2007
Hello,
does attached patch look okay?
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpcodecs/ad_ffmpeg.c
===================================================================
--- libmpcodecs/ad_ffmpeg.c (revision 22709)
+++ libmpcodecs/ad_ffmpeg.c (working copy)
@@ -150,7 +150,7 @@
unsigned char *start=NULL;
int y,len=-1;
while(len<minlen){
- int len2=0;
+ int len2=maxlen;
double pts;
int x=ds_get_packet_pts(sh_audio->ds,&start, &pts);
if(x<=0) break; // error
@@ -158,7 +158,7 @@
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(y<x) sh_audio->ds->buffer_pos+=y-x; // put back data (HACK!)
More information about the MPlayer-dev-eng
mailing list