[MPlayer-dev-eng] [patch] fix premature end of audio playback

Jindrich Makovicka makovick at kmlinux.fjfi.cvut.cz
Sat Jan 7 15:11:39 CET 2006


Reimar Döffinger wrote:
> 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).

It indicates that there are still data to copy from a_buffer to
a_out_buffer. These buffers do not need to be the same.

> 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.

Agree. There also is something in the Mikulas' patchset

http://urtax.ms.mff.cuni.cz/~mikulas/mplayer-patchset/cut-end-of-audio-file.diff


, but I didn't check it out yet, as I don't use mplayer for playing
audio-only files at all.

-- 
Jindrich Makovicka




More information about the MPlayer-dev-eng mailing list