[MPlayer-dev-eng] [PATCH] ao_jack: add "connect" suboption

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon May 27 22:39:30 CEST 2013


On Sun, May 05, 2013 at 02:22:17AM +0200, Markus Appel wrote:
> I hope I could convince you ;) I attached a diff to r36233.

Yes.

> @@ -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.

> +   // 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.

> -  // 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.

> @@ -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.


More information about the MPlayer-dev-eng mailing list