[xiph-commits] r9644 - trunk/theora/examples

msmith at svn.xiph.org msmith at svn.xiph.org
Fri Jul 29 09:03:30 PDT 2005


Author: msmith
Date: 2005-07-29 09:03:28 -0700 (Fri, 29 Jul 2005)
New Revision: 9644

Modified:
   trunk/theora/examples/dump_video.c
Log:
Invert default, make it work a little better.


Modified: trunk/theora/examples/dump_video.c
===================================================================
--- trunk/theora/examples/dump_video.c	2005-07-29 15:45:23 UTC (rev 9643)
+++ trunk/theora/examples/dump_video.c	2005-07-29 16:03:28 UTC (rev 9644)
@@ -47,10 +47,10 @@
 
 
 
-const char *optstring = "o:";
+const char *optstring = "or:";
 struct option options [] = {
   {"output",required_argument,NULL,'o'},
-  {"yuv4mpeg2",0, NULL, 'y'}, /* Output YUV4MPEG2, for encoder_example input */
+  {"raw",required_argument, NULL, 'r'}, /* Output YUV4MPEG2, for encoder_example input */
   {NULL,0,NULL,0}
 };
 
@@ -80,7 +80,7 @@
 int          videobuf_ready=0;
 ogg_int64_t  videobuf_granulepos=-1;
 double       videobuf_time=0;
-int          yuv4mpeg2 = 0;
+int          raw = 0;
 
 FILE* outfile = NULL;
 
@@ -102,7 +102,7 @@
   yuv_buffer yuv;
   theora_decode_YUVout(&td,&yuv);
 
-  if(yuv4mpeg2)
+  if(!raw)
     fprintf(outfile, "FRAME\n");
   for(i=0;i<yuv.y_height;i++)
     fwrite(yuv.y+yuv.y_stride*i, 1, yuv.y_width, outfile);
@@ -177,8 +177,12 @@
         exit(1);
       }
       break;
-      case 'y':
-      yuv4mpeg2 = 1;
+      case 'r':
+      if(sscanf(optarg, "%u", &raw) != 1) {
+          fprintf(stderr, "Invalid option, assuming YUV4MPEG4 output\n");
+          raw = 0;
+      }
+
       break;
 
       default:
@@ -304,7 +308,7 @@
   /* open video */
   if(theora_p)open_video();
 
-  if(yuv4mpeg2)
+  if(!raw)
     fprintf(outfile, "YUV4MPEG2 W%d H%d F%d:%d I%c A%d:%d\n",
           ti.width, ti.height, ti.fps_numerator, ti.fps_denominator, 'p', 
           ti.aspect_numerator, ti.aspect_denominator);



More information about the commits mailing list