shithub: sox

Download patch

ref: a8196df4e65fabab6562e7d2bab37bca7ac9ef02
parent: 58e2503190a598aa2d74f633cd90f295a544a089
author: jching <jching>
date: Sat Apr 6 23:32:39 EDT 2002

Remove extra test if we know it will always be false.

--- a/src/alsa.c
+++ b/src/alsa.c
@@ -196,7 +196,7 @@
     while ((size << 1) < bps) size <<= 1;
     if (size > ft->file.size) size = ft->file.size;
     if (size < c_info.min_fragment_size) size = c_info.min_fragment_size;
-    if (size > c_info.max_fragment_size) size = c_info.max_fragment_size;
+    else if (size > c_info.max_fragment_size) size = c_info.max_fragment_size;
     c_params.buf.block.frag_size = size;
     c_params.buf.block.frags_max = 32;
     c_params.buf.block.frags_min = 1;
@@ -259,7 +259,7 @@
     while ((size << 1) < bps) size <<= 1;
     if (size > ft->file.size) size = ft->file.size;
     if (size < p_info.min_fragment_size) size = p_info.min_fragment_size;
-    if (size > p_info.max_fragment_size) size = p_info.max_fragment_size;
+    else if (size > p_info.max_fragment_size) size = p_info.max_fragment_size;
     p_params.buf.block.frag_size = size;
     p_params.buf.block.frags_max = -1; /* Little trick (playback only) */
     p_params.buf.block.frags_min = 1;