[vlc-devel] [PATCH] karaoke : setting the output to mono

Rémi Denis-Courmont remi at remlab.net
Thu Mar 8 09:18:38 CET 2012


On Wed, 7 Mar 2012 10:55:53 -0800, Sukrit Sangwan
<sukritsangwan at gmail.com>
wrote:
> Eh you cannot do that. First it leaves some fields in the format in
>> inconsistent state.
> 
> 
> If you are talking of *fmt_out.audio.i_bitspersample*
> I verified it by using msg_Err().. ( msg_Err() method seemed to be easy
)

That's one. There is PrepareFormat-something to fix those fields.
In fact, you shouldn't need to set i_channels.

>> Second, I'm not sure how the core behaves if a filter
>> changes the format... ?
>>
> 
> I saw similar thing in stereo2mono audio filter.
>
http://git.videolan.org/?p=vlc.git;a=blob;f=modules/audio_filter/channel_mixer/mono.cline
> 419..
> 
> Firstly i was changing format in the *Process* funcion. It didn't work.
> And then i tried it in the *OpenFilter* function.

Unfortunately, the audio filter stuff has evolved in a not very consistent
and not very designed manner over the years. This is not really documented,
and thus overriding the output format might work or not depending on the
situation.

I don't thinkg b_allow_change_fmt is correctly initialized for audio
filters.

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list