[MPlayer-dev-eng] [patch] fix premature end of audio playback
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Jan 7 00:03:11 CET 2006
Hi,
On Thu, Dec 29, 2005 at 06:15:24PM +0100, Jindrich Makovicka wrote:
> this patch fixes $subj when playing through audio filters.
>
> The bug can be observed on http://voffka.com/archives/zp.avi
>
> while(sh_audio->a_out_buffer_len<playsize &&
> - (!d_audio->eof || sh_audio->a_in_buffer_len > 0)){
> + (!d_audio->eof || sh_audio->a_in_buffer_len > 0 || sh_audio->a_buffer_len > 0)){
> int ret=decode_audio(sh_audio,&sh_audio->a_out_buffer[sh_audio->a_out_buffer_len],
> playsize-sh_audio->a_out_buffer_len,sh_audio->a_out_buffer_size-sh_audio->a_out_buffer_len);
> if(ret<=0) { // EOF?
Hmmm... well, it doesn't really make sense to me. Why does the fact that
the _output_ buffer is not empty indicate that we must decode more data
(esp. since there shouldn't be anything to decode anymore).
Also, the same condition is used in another place to detect when to
switch to the next fil for audio-only files, so it might be that even
this patch will still leave a bug in the audio-only case.
Greetings,
Reimar Döffinger
More information about the MPlayer-dev-eng
mailing list