[MPlayer-dev-eng] [PATCH] Bug fix in af_add/del/switch/clr

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Jan 24 21:04:15 CET 2011


On Mon, Jan 24, 2011 at 08:38:54PM +0100, Dan Oscarsson wrote:
> mån 2011-01-24 klockan 19:21 +0100 skrev Reimar Döffinger:
> > 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:
> > > 
> > > 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.
> 
> I assume if you change number of channels or format you have to
> reconfigure audio out too?

Yes. I just wrongly thought that was handled in the af_init, but
it's actually the other way round.
I guess we should just try removing it in that case.
There's a good chance there's some corner-case where such code is
actually necessary but I can't think of anything right now.


More information about the MPlayer-dev-eng mailing list