qt-faststart: simplify code by using FFMIN
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 30 Sep 2012 19:53:26 +0000 (21:53 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 30 Sep 2012 20:19:54 +0000 (22:19 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tools/qt-faststart.c

index b1917f1..b9dbdfd 100644 (file)
@@ -303,10 +303,7 @@ int main(int argc, char *argv[])
     }
     printf(" copying rest of file...\n");
     while (last_offset) {
-        if (last_offset > COPY_BUFFER_SIZE)
-            bytes_to_copy = COPY_BUFFER_SIZE;
-        else
-            bytes_to_copy = last_offset;
+        bytes_to_copy = FFMIN(bytes_to_copy, last_offset);
 
         if (fread(copy_buffer, bytes_to_copy, 1, infile) != 1) {
             perror(argv[1]);