[MPlayer-dev-eng] [PATCH] Bug fix in af_add/del/switch/clr
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Mon Jan 24 19:21:01 CET 2011
On Sun, Jan 23, 2011 at 09:02:58PM +0100, Dan Oscarsson wrote:
> sön 2011-01-23 klockan 20:17 +0100 skrev Reimar Döffinger:
>
> > > Attached is the small patch file.
> > > You can try the bug reproduction before and after, and confirms it has
> > > been fixed (I confirmed it on my machine and the user who reported me
> > > the bug also did for him).
> >
> > Of course an interesting question is why does it fix it.
> > What is reinit_audio_chain doing that causes it?
> > Because probably reinit_audio_chain could and should be fixed,
> > from which other places that use it might benefit as well.
>
> As part of my patches for new a-v sync handling (of which I have only
> yet tried to get the first part accepted) I also had problem with audio
> data being lost when speed was changed. I traced this to
>
> sh_audio->a_out_buffer_len = 0;
>
> in init_audio_filters of libmpcodecs/dec_audio.c.
>
> That line deletes any decoded audio in buffer which can result in audio
> being lost when filters are changed. I have had that line commented out
> for over a year with no bad effects.
I think you didn't test enough in that case.
It should break horribly if number of channels or sample format changes.
Any left-over data will be interpreted as in the new format.
Testing with adding/removing a -af format filter might be able to test this.
More information about the MPlayer-dev-eng
mailing list