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

Ralph Giles giles at xiph.org
Sun Aug 12 23:09:14 PDT 2001



giles       01/08/12 23:09:14

  Modified:    oggenc   audio.c oggenc.c
  Log:
  improve untuned sample rate warnings

Revision  Changes    Path
1.14      +13 -10    vorbis-tools/oggenc/audio.c

Index: audio.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/audio.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- audio.c	2001/07/29 00:59:18	1.13
+++ audio.c	2001/08/13 06:09:13	1.14
@@ -285,9 +285,10 @@
         {
                 /* From here on, this is very similar to the wav code. Oh well. */
                 
-		if(format.rate != 44100)
-			fprintf(stderr,"Warning: Vorbis is currently untuned for input\n"
-					       "at other than 44.1kHz, quality may be degraded.\n");
+		if(format.rate != 44100 && format.rate != 48000)
+			fprintf(stderr, "Warning: Vorbis is not currently tuned for this input (%.3f kHz).\n"
+				" At other than 44.1/48 kHz quality will be degraded.\n",
+				(float)format.rate * 1.0e-3);
 
                 opt->rate = format.rate;
                 opt->channels = format.channels;
@@ -413,10 +414,11 @@
         if( format.align == format.channels*samplesize &&
                         format.samplesize == samplesize*8)
         {
-		if(format.samplerate != 44100)
-			fprintf(stderr, "Warning: Vorbis is currently not tuned for input\n"
-							" at other than 44.1kHz. Quality may be somewhat\n"
-							" degraded.\n");
+		if(format.samplerate != 44100 && format.samplerate != 48000)
+			fprintf(stderr, "Warning: Vorbis is not currently tuned for this input (%.3f kHz).\n"
+					" At other than 44.1/48 kHz quality will be degraded.\n",
+					(float)format.samplerate * 1.0e-3);
+
                 /* OK, good - we have the one supported format,
                    now we want to find the size of the file */
                 opt->rate = format.samplerate;
@@ -553,9 +555,10 @@
         wav_fmt format; /* fake wave header ;) */
         wavfile *wav = malloc(sizeof(wavfile));
 
-	if(opt->rate != 44100)
-		fprintf(stderr,"Warning: Vorbis is currently untuned for input\n"
-				       "at other than 44.1kHz, quality may be degraded.\n");
+	if(opt->rate != 44100 && opt->rate != 48000)
+		fprintf(stderr, "Warning: Vorbis is not currently tuned for this input (%.3f kHz).\n"
+				" At other than 44.1/48 kHz quality will be significantly degraded.\n",
+				(float)opt->rate * 1.0e-3);
 
         /* construct fake wav header ;) */
         format.format =      2; 

1.25      +2 -2      vorbis-tools/oggenc/oggenc.c

Index: oggenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/oggenc.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- oggenc.c	2001/08/13 05:43:23	1.24
+++ oggenc.c	2001/08/13 06:09:14	1.25
@@ -538,12 +538,12 @@
                                 if (opt->rawmode != 1)
                                 {
                                         opt->rawmode = 1;
-					fprintf(stderr, "WARNING: Raw samplerate specified for non-raw data. Assuming input is raw.\n");
+					fprintf(stderr, "WARNING: Raw sample rate specified for non-raw data. Assuming input is raw.\n");
                                 }
                                 if(sscanf(optarg, "%u", &opt->raw_samplerate) != 1)
                                 {
                                         opt->raw_samplerate = 44100; /* Failed, so just set to 44100 */
-					fprintf(stderr, "WARNING: Invalid samplerate specified, assuming 44100.\n");
+					fprintf(stderr, "WARNING: Invalid sample rate specified, assuming 44100.\n");
                                 }
                                 break;
                         case '?':

--- >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