[MPlayer-dev-eng] [PATCH] Support for QNX: QSA audio and Photon GUI.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Feb 6 19:57:44 CET 2013

On Wed, Feb 06, 2013 at 04:03:30PM +0200, Mike Gorchak wrote:
> > indent is too inflexible and unreliable. We have uncrustify rules though:
> > TOOLS/mp-uncrustify-style.cfg.
> Ok, I used it. Why not to use it for all mplayer sources and commit
> them at once?
> > I'll admit that we certainly overdo it sometimes though.
> Yeah, sometimes I spend less efforts to maintain a separate fork than
> commit something to mplayer.
> I've attached latest patch with the fixes we discussed yesterday with you.

Why are you still doing such overcomplicated logic for the fallback?
I can't see how anyone would be able to figure out if it really does
anything sensible in absolutely all cases.
For example is this line really as intended?
>                     qsa_rate = qsa_rate_fallback(rate);
My guess was that the argument should be qsa_rate.
Also in
>                 if (channels != 0) {
>                     try_again = 1;
>                 } else {
shouldn't the else be unreachable since we break out of the loop
when channels becomes 0?
I was really serious when I suggested to fall back to a few "will
always work" formats.
Generally just trying S16_NE and 48000 and 44100 will cover almost
Admittedly if the API really has no way to query support for just the
format or at least to indicate which of the settings causes problems the
fallback handling is going to be a big problem either way.
Btw. is it intentional that you don't update cpars.buf.block.frag_size
when you change the fallback format?
The problem with that is that ao_data.outburst absolutely should be a
multiple of the sample size (as in channels*format_bits/8) and you
calculate that based on it.

>     snd_pcm_channel_status_t cstatus;
>     memset(&cstatus, 0, sizeof(cstatus));
>     cstatus.channel = SND_PCM_CHANNEL_PLAYBACK;

A somewhat nicer way of doing this is

snd_pcm_channel_status_t cstatus = { .channel = SND_PCM_CHANNEL_PLAYBACK };

More information about the MPlayer-dev-eng mailing list