[xiph-commits] r16239 - experimental/giles/rogg

giles at svn.xiph.org giles at svn.xiph.org
Thu Jul 9 17:39:41 PDT 2009


Author: giles
Date: 2009-07-09 17:39:40 -0700 (Thu, 09 Jul 2009)
New Revision: 16239

Modified:
   experimental/giles/rogg/rogg_framerate.c
Log:
Merge changes from Tim's version of the fps-change script.

Basically prefer fps_* to rate_* as a variable name.


Modified: experimental/giles/rogg/rogg_framerate.c
===================================================================
--- experimental/giles/rogg/rogg_framerate.c	2009-07-10 00:32:49 UTC (rev 16238)
+++ experimental/giles/rogg/rogg_framerate.c	2009-07-10 00:39:40 UTC (rev 16239)
@@ -25,7 +25,7 @@
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-/* theora aspect-ratio mod script using the rogg library */
+/* theora frame rate mod script using the rogg library */
 
 /* compile with
    gcc -O2 -g -Wall -I. -o rogg_framerate rogg.c rogg_framerate.c
@@ -45,9 +45,9 @@
 #include <rogg.h>
 
 int verbose = 0;
-int rate_set = 0;
-int rate_num = 0;
-int rate_den = 0;
+int fps_set = 0;
+int fps_num = 0;
+int fps_den = 0;
 
 /* big endian accessors for the theora header data */
 int get16(unsigned char *data)
@@ -134,13 +134,12 @@
 	  shift = 1; 
 	  break;
 	case 'f':
-	  rate_set = 1;
+	  fps_set = 1;
 	  /* read frame rate from the next arg */
-	  if (sscanf(argv[arg+1], "%d:%d", &rate_num, &rate_den) !=2 ) 
-{
-	    fprintf(stderr, "Could not parse aspect ratio '%s'.\n", argv[arg+1]);
+	  if (sscanf(argv[arg+1], "%d:%d", &fps_num, &fps_den) !=2 ) {
+	    fprintf(stderr, "Could not parse frame rate '%s'.\n", argv[arg+1]);
 	    fprintf(stderr, "Try something like 25:1 (PAL) or 30000:1001 (NTSC)\n\n");
-	    rate_set = 0;
+	    fps_set = 0;
 	  }
 	  shift = 2;
 	  break;
@@ -220,11 +219,11 @@
 	}
 	if (!memcmp(header.data, "\x80theora", 7)) {
 	  print_theora_info(stdout, header.data);
-	  if (rate_set) {
+	  if (fps_set) {
 	    fprintf(stdout, "Setting frame rate to %d:%d\n",
-		rate_num, rate_den);
-	    put32(header.data+22, rate_num); /* numerator */
-	    put32(header.data+26, rate_den); /* denominator */
+		fps_num, fps_den);
+	    put32(header.data+22, fps_num); /* numerator */
+	    put32(header.data+26, fps_den); /* denominator */
 	    rogg_page_update_crc(q);
 	    fprintf(stdout, "New settings:\n");
 	    print_theora_info(stdout, header.data); 



More information about the commits mailing list