allow raw pcm files
authorcwolf <cwolf@xiph.org>
Wed, 19 Sep 2001 01:17:00 +0000 (01:17 +0000)
committercwolf <cwolf@xiph.org>
Wed, 19 Sep 2001 01:17:00 +0000 (01:17 +0000)
svn path=/trunk/vorbis/; revision=2064

examples/encoder_example.c

index 40d4e36..59d27c2 100644 (file)
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: simple example encoder
- last mod: $Id: encoder_example.c,v 1.26 2001/09/17 01:33:07 cwolf Exp $
+ last mod: $Id: encoder_example.c,v 1.27 2001/09/19 01:17:00 cwolf Exp $
 
  ********************************************************************/
 
@@ -77,7 +77,7 @@ int main(){
      example, after all. */
 
   readbuffer[0] = '\0';
-  for (i=0, founddata=0; i<40 && ! feof(stdin) && ! ferror(stdin); i++)
+  for (i=0, founddata=0; i<30 && ! feof(stdin) && ! ferror(stdin); i++)
   {
     fread(readbuffer,1,2,stdin);
 
@@ -88,18 +88,6 @@ int main(){
     }
   }
 
-  if ( feof(stdin) || ferror(stdin) )
-  {
-    (void)fprintf(stderr, "Error: Input WAV too short, or corrupt.\n");
-    return(1);
-  }
-
-  if ( ! founddata )
-  {
-    (void)fprintf(stderr, "Error: Can't find \"data\" chunk in WAV input.\n");
-    return(1);
-  }
-
   /********** Encode setup ************/
 
   /* choose an encoding mode */