[xiph-commits] r16981 - trunk/ffmpeg2theora/src

j at svn.xiph.org j at svn.xiph.org
Wed Mar 17 08:54:34 PDT 2010


Author: j
Date: 2010-03-17 08:54:34 -0700 (Wed, 17 Mar 2010)
New Revision: 16981

Modified:
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
use .oga if video is disabled

Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-03-17 15:52:24 UTC (rev 16980)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-03-17 15:54:34 UTC (rev 16981)
@@ -2544,16 +2544,17 @@
             snprintf(inputfile_name,sizeof(inputfile_name),"pipe:");
         }
         if (outputfile_set!=1) {
-            /* reserve 4 bytes in the buffer for the `.ogv' extension */
-            snprintf(outputfile_name, sizeof(outputfile_name) - 4, "%s", argv[optind]);
+            /* reserve 4 bytes in the buffer for the `.og[va]' extension */
+            const char *ext = convert->disable_video?".oga":".ogv";
+            snprintf(outputfile_name, sizeof(outputfile_name) - strlen(ext), "%s", argv[optind]);
             if ((str_ptr = strrchr(outputfile_name, '.'))) {
-                sprintf(str_ptr, ".ogv");
+                sprintf(str_ptr, ext);
                 if (!strcmp(inputfile_name, outputfile_name)) {
-                    snprintf(outputfile_name, sizeof(outputfile_name), "%s.ogv", inputfile_name);
+                    snprintf(outputfile_name, sizeof(outputfile_name), "%s%s", inputfile_name, ext);
                 }
             }
             else {
-                snprintf(outputfile_name, sizeof(outputfile_name), "%s.ogv", outputfile_name);
+                snprintf(outputfile_name, sizeof(outputfile_name), "%s%s", outputfile_name, ext);
             }
             outputfile_set=1;
         }



More information about the commits mailing list