]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Fix arecord to quit properly at max file size
authorTakashi Iwai <tiwai@suse.de>
Wed, 26 Apr 2006 14:11:57 +0000 (16:11 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 26 Apr 2006 14:11:57 +0000 (16:11 +0200)
Fix arecord to quit properly at the max file size of the given format.

aplay/aplay.c

index fa3fb4ed2edba8bc43b864946a05af7936e4a9b7..7c3d7cdf579531ba8d212fb124e7fd3dca1228e1 100644 (file)
@@ -2165,13 +2165,15 @@ static void capture(char *name_)
                           2) all requested samples/bytes have been captured (cur>0)
                           3) filesize threshold was reached (fdcount<wrthreshold)
                        */
-               } while (file_type == FORMAT_RAW && !timelimit && cur>0 && fdcount<fmt_rec_table[file_type].max_filesize);
+               } while (file_type == FORMAT_RAW && !timelimit && cur>0 &&
+                        fdcount<fmt_rec_table[file_type].max_filesize);
 
                /* finish sample container */
                fmt_rec_table[file_type].end(fd);
 
                /* repeat the loop when format is raw without timelimit or filesize threshold was reached */
-       } while((file_type == FORMAT_RAW && !timelimit) || fdcount>=fmt_rec_table[file_type].max_filesize);
+       } while((file_type == FORMAT_RAW && !timelimit) ||
+               fdcount < fmt_rec_table[file_type].max_filesize);
 }
 
 void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t count, int rtype, char **names)