shithub: alienpatch

Download patch

ref: ebf7f89465a4928b39900e9d851d995907b405e3
parent: 4f91000e376741aafce8cbac89f4a3f871b2e60c
author: qwx <qwx@sciops.net>
date: Mon Jan 13 03:28:20 EST 2020

opus-tools-defaults: fix usage prints

--- a/opus-tools-defaults
+++ b/opus-tools-defaults
@@ -1,6 +1,43 @@
 --- /mnt/git/branch/heads/test3-appveyor/tree/src/opusdec.c	Sun Jan 12 23:58:30 2020
-+++ src/opusdec.c	Mon Jan 13 00:17:17 2020
-@@ -683,7 +683,7 @@ int main(int argc, char **argv)
++++ src/opusdec.c	Mon Jan 13 09:25:12 2020
+@@ -436,27 +436,13 @@ void usage(void)
+     defined HAVE_SYS_AUDIOIO_H || defined WIN32 || defined _WIN32
+    printf("Usage: opusdec [options] input [output]\n");
+ #else
+-   printf("Usage: opusdec [options] input output\n");
++   printf("Usage: opusdec [options]\n");
+ #endif
+-   printf("\n");
+-   printf("Decode audio in Opus format to Wave or raw PCM\n");
+-   printf("\n");
+-   printf("input can be:\n");
+-   printf("  file:filename.opus   Opus URL\n");
+-   printf("  filename.opus        Opus file\n");
+-   printf("  -                    stdin\n");
+-   printf("\n");
+-   printf("output can be:\n");
+-   printf("  filename.wav         Wave file\n");
+-   printf("  filename.*           Raw PCM file (any extension other than .wav)\n");
+-   printf("  -                    stdout (raw; unless --force-wav)\n");
+ #if defined HAVE_LIBSNDIO || defined HAVE_SYS_SOUNDCARD_H || \
+     defined HAVE_MACHINE_SOUNDCARD_H || defined HAVE_SOUNDCARD_H || \
+     defined HAVE_SYS_AUDIOIO_H || defined WIN32 || defined _WIN32
+    printf("  (default)            Play audio\n");
+ #endif
+-   printf("\n");
+-   printf("Options:\n");
+    printf(" -h, --help            Show this help\n");
+    printf(" -V, --version         Show version information\n");
+    printf(" --quiet               Suppress program output\n");
+@@ -468,7 +454,6 @@ void usage(void)
+    printf(" --force-wav           Force Wave header on output\n");
+    printf(" --packet-loss n       Simulate n %% random packet loss\n");
+    printf(" --save-range file     Save check values for every frame to a file\n");
+-   printf("\n");
+ }
+ 
+ void version(void)
+@@ -683,7 +668,7 @@ int main(int argc, char **argv)
     int file_output;
     int old_li=-1;
     int li;
@@ -9,7 +46,7 @@
     int forcewav = 0;
     ogg_int64_t nb_read_total=0;
     ogg_int64_t link_read=0;
-@@ -709,10 +709,10 @@ int main(int argc, char **argv)
+@@ -709,10 +694,10 @@ int main(int argc, char **argv)
     float loss_percent=-1;
     float manual_gain=0;
     int force_rate=0;
@@ -22,7 +59,7 @@
     int wav_format=0;
     int dither=1;
     int fp=0;
-@@ -801,13 +801,7 @@ int main(int argc, char **argv)
+@@ -801,13 +786,7 @@ int main(int argc, char **argv)
           goto done;
        }
     }
@@ -37,7 +74,7 @@
  
     /*Output to a file or playback?*/
     file_output=argc_utf8-optind==2;
-@@ -824,7 +818,7 @@ int main(int argc, char **argv)
+@@ -824,7 +803,7 @@ int main(int argc, char **argv)
       }
       wav_format|=forcewav;
     } else {
@@ -47,8 +84,30 @@
       /*If playing to audio out, default the rate to 48000
         instead of the original rate. The original rate is
 --- /mnt/git/branch/heads/test3-appveyor/tree/src/opusenc.c	Sun Jan 12 23:58:30 2020
-+++ src/opusenc.c	Mon Jan 13 00:20:27 2020
-@@ -417,7 +417,7 @@ int main(int argc, char **argv)
++++ src/opusenc.c	Mon Jan 13 09:25:59 2020
+@@ -117,20 +117,12 @@ static void opustoolsversion_short(const
+ 
+ static void usage(void)
+ {
+-  printf("Usage: opusenc [options] input_file output_file.opus\n");
+-  printf("\n");
+-  printf("Encode audio using Opus.\n");
++  printf("Usage: opusenc [options]\n");
+ #if defined(HAVE_LIBFLAC)
+   printf("The input format can be Wave, AIFF, FLAC, Ogg/FLAC, or raw PCM.\n");
+ #else
+   printf("The input format can be Wave, AIFF, or raw PCM.\n");
+ #endif
+-  printf("\ninput_file can be:\n");
+-  printf("  filename.wav      file\n");
+-  printf("  -                 stdin\n");
+-  printf("\noutput_file can be:\n");
+-  printf("  filename.opus     compressed file\n");
+-  printf("  -                 stdout\n");
+   printf("\nGeneral options:\n");
+   printf(" -h, --help         Show this help\n");
+   printf(" -V, --version      Show version information\n");
+@@ -417,7 +409,7 @@ int main(int argc, char **argv)
    time_t             last_spin=0;
    int                last_spin_len=0;
    /*Settings*/
@@ -57,7 +116,7 @@
    opus_int32         bitrate=-1;
    opus_int32         rate=48000;
    opus_int32         frame_size=960;
-@@ -458,12 +458,12 @@ int main(int argc, char **argv)
+@@ -458,12 +450,12 @@ int main(int argc, char **argv)
    range_file=NULL;
    in_format=NULL;
    inopt.channels=chan;
@@ -72,7 +131,7 @@
    inopt.ignorelength=0;
    inopt.copy_comments=1;
    inopt.copy_pictures=1;
-@@ -790,12 +790,8 @@ int main(int argc, char **argv)
+@@ -790,12 +782,8 @@ int main(int argc, char **argv)
          break;
      }
    }