[PATCH v2 01/18] Move pa_format_info_to_sample_spec_fake() to core-format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2013-12-27 at 15:27 +0530, Arun Raghavan wrote:
> On Wed, 2013-12-18 at 19:28 +0200, Tanu Kaskinen wrote:
> > I will need to use the function from outside libpulse.
> > 
> > I added the channel map argument, because the function will be called
> > from another function that is expected to initialize the channel map.
> > I don't know if it's in practice necessary, but it shouldn't do any
> > harm either.
> > ---
> 
> I'd leave the channel map out of it because we're expected to use this
> function for non-PCM formats, for which setting the channel map is
> meaningless.

I now checked the code to see if the channel map argument is necessary
or not. It seems that it's necessary (meaning that if it's removed, code
needs to be changed elsewhere).

Sink inputs should always have a valid channel map set, even if it's
"meaningless". Previously the channel map validity was ensured in
pa_sink_input_new(), but now it's done in
pa_format_info_to_sample_spec2(). I could remove the channel map
parameter from pa_format_info_to_sample_spec_fake(), but then I would
need to change this code in pa_format_info_to_sample_spec2():

    if (!pa_format_info_is_pcm(f))
        return pa_format_info_to_sample_spec_fake(f, ss, map);

to this:

    if (!pa_format_info_is_pcm(f)) {
        r = pa_format_info_to_sample_spec_fake(f, ss);
        if (r >= 0)
            pa_channel_map_init_stereo(map);
        return r;
    }

and I don't really see the point in doing that, so I prefer keeping the
channel map argument in pa_format_info_to_sample_spec_fake().

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux