# HG changeset patch # User reimar # Date 1289058501 0 # Node ID 5376d7337fcf469d10ae60ea4b8e3fe01a962744 # Parent cfa30cde4b69bf268adc7e50216072392874ece7 Handle EAGAIN in ad_ffmpeg, this is necessary for LATM to work properly with native TS demuxer. diff -r cfa30cde4b69 -r 5376d7337fcf libmpcodecs/ad_ffmpeg.c --- a/libmpcodecs/ad_ffmpeg.c Sat Nov 06 15:41:44 2010 +0000 +++ b/libmpcodecs/ad_ffmpeg.c Sat Nov 06 15:48:21 2010 +0000 @@ -234,6 +234,9 @@ } 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); + // LATM may need many packets to find mux info + if (y == AVERROR(EAGAIN)) + continue; if(y<0){ mp_msg(MSGT_DECAUDIO,MSGL_V,"lavc_audio: error\n");break; } if(!sh_audio->parser && yds->buffer_pos+=y-x; // put back data (HACK!)