Re: [PATCH v2 1/2] amidi: add delay option

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

 



Felipe F. Tonello wrote:
> This patch adds a new options to amidi tool to add a delay (in milliseconds)
> to each MIDI message.
     ^^^^
Not anymore.

> +		if (!delay) {
> +				if ((err = snd_rawmidi_write(output, send_data, send_data_length)) < 0) {
> +					error("cannot send data: %s", snd_strerror(err));
> +					return err;
> +				}
> +		} else {

Too much indentation.

> +				/* find beginning of SysEx and its end */
> +				while((unsigned char)data[len] != 0xf0 &&
> +				      (data + len) < (send_data + send_data_length))
> +					len++;
> +
> +				while((unsigned char)data[len] != 0xf7 &&
> +				      (data + len) < (send_data + send_data_length))
> +					len++;
> +				len++;

It is not necessary to search for both beginning and end.

And the search can be simplified with memchr().


Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux