[MPlayer-dev-eng] [PATCH] ao_jack: add "connect" suboption
Markus Appel
masolomaster3000 at googlemail.com
Sat Jun 1 17:23:18 CEST 2013
On 05/27/2013 10:39 PM, Reimar Döffinger wrote:
>> @@ -241,20 +245,23 @@
>> buffer = av_fifo_alloc(BUFFSIZE);
>> jack_set_process_callback(client, outputaudio, 0);
>>
>> - // list matching ports
>> - if (!port_name)
>> - port_flags |= JackPortIsPhysical;
>> - matching_ports = jack_get_ports(client, port_name, NULL, port_flags);
>> - i = 0;
>> - while (matching_ports && matching_ports[i]) i++;
>> - if (!i) {
>> - mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] no physical ports available\n");
>> - goto err_out;
>> + // list matching ports if connections should be made
>> + if (connect) {
>
> Trailing whitespace.
Oops. Sorry.
>
>> + // list matching ports
>> + if (!port_name)
>> + port_flags |= JackPortIsPhysical;
>> + matching_ports = jack_get_ports(client, port_name, NULL, port_flags);
>> + i = 0;
>> + while (matching_ports && matching_ports[i]) i++;
>> + if (!i) {
>> + mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] no physical ports available\n");
>> + goto err_out;
>> + }
>> + if (channels > i) channels = i;
>> }
>> - if (channels > i) channels = i;
>
> I'd prefer this without the reindentation, I can fix that up myself
> afterwards.
Fair enough. As you wish :)
>
>> - // create out output ports
>> + // create output ports
>
> That's not how it was meant, I tried to make it clearer.
> Though I guess your variant would have been fine as well.
>
Ok, I saw your modification.
>> @@ -268,7 +275,7 @@
>> mp_msg(MSGT_AO, MSGL_FATAL, "[JACK] activate failed\n");
>> goto err_out;
>> }
>> - for (i = 0; i < num_ports && matching_ports && matching_ports[i]; i++) {
>> + for (i = 0; i < num_ports && connect && matching_ports && matching_ports[i]; i++) {
>
> That change should not be necessary, matching_ports should be NULL when
> connect is false.
You're right, I got rid of it.
Voilà the diff to r36294!
Cheers,
Markus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer36294_jack_connect.patch
Type: text/x-patch
Size: 2704 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20130601/fff72456/attachment.bin>
More information about the MPlayer-dev-eng
mailing list