[xiph-cvs] cvs commit: vorbis-tools/oggenc oggenc.c

Michael Smith msmith at xiph.org
Tue Jul 2 07:04:30 PDT 2002



msmith      02/07/02 07:04:30

  Modified:    oggenc   oggenc.c
  Log:
  Give a warning if a resampling frequency of < 100 Hz is specified. This would
  generally mean that the user was expecting kHz instead of Hz. Suggests a
  different value to use.

Revision  Changes    Path
1.62      +6 -1      vorbis-tools/oggenc/oggenc.c

Index: oggenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/oggenc.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- oggenc.c	2002/07/01 11:47:50	1.61
+++ oggenc.c	2002/07/02 14:04:29	1.62
@@ -385,7 +385,7 @@
                 "                      instead of specifying a particular bitrate.\n"
                 "                      This is the normal mode of operation.\n"
         "                      Fractional qualities (e.g. 2.75) are permitted\n"
-        " --resample n         Resample input data to sampling rate n\n"
+        " --resample n         Resample input data to sampling rate n (Hz)\n"
         " --downmix            Downmix stereo to mono. Only allowed on stereo\n"
         "                      input.\n"
                 " -s, --serial         Specify a serial number for the stream. If encoding\n"
@@ -577,6 +577,11 @@
                         fprintf(stderr, _("WARNING: Couldn't read resampling frequency \"%s\"\n"), optarg);
                                             opt->resamplefreq = 0;
                     }
+                    if(opt->resamplefreq < 100) /* User probably specified it
+                                                   in kHz accidently */
+                        fprintf(stderr, 
+                                _("Warning: Resample rate specified as %d Hz. Did you mean %d Hz?\n"), 
+                                opt->resamplefreq, opt->resamplefreq*1000);
                 }
                 else if(!strcmp(long_options[option_index].name, "downmix")) {
                     opt->downmix = 1;

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list