[xiph-commits] r9551 - trunk/ffmpeg2theora

j at svn.xiph.org j at svn.xiph.org
Wed Jul 6 12:46:59 PDT 2005


Author: j
Date: 2005-07-06 12:46:51 -0700 (Wed, 06 Jul 2005)
New Revision: 9551

Modified:
   trunk/ffmpeg2theora/ffmpeg2theora.c
   trunk/ffmpeg2theora/theorautils.c
Log:
make versions of gcc that hate mixed code and definitions 
happy, it's not proper C anyway, thanks adam at gimp dot org



Modified: trunk/ffmpeg2theora/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/ffmpeg2theora.c	2005-07-06 17:37:47 UTC (rev 9550)
+++ trunk/ffmpeg2theora/ffmpeg2theora.c	2005-07-06 19:46:51 UTC (rev 9551)
@@ -97,7 +97,7 @@
         this->video_quality=31.5; // video quality 5
         this->video_bitrate=0;
         this->sharpness=2;
-        this->keyint=64;
+        this->keyint=1111;
         this->force_input_fps=0;
         this->sync=0;
         this->aspect_numerator=0;
@@ -338,6 +338,7 @@
         uint8_t *ptr;
         int16_t *audio_buf= av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
         int16_t *resampled= av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
+        int no_frames;
 
         if(this->video_index >= 0)
             info.audio_only=0;
@@ -403,7 +404,7 @@
 
             info.ti.target_bitrate = this->video_bitrate; 
             info.ti.quality = this->video_quality;
-            info.ti.dropframes_p = 0;
+            info.ti.dropframes_p = 1;
             info.ti.quick_p = 1;
             info.ti.keyframe_auto_p = 1;
             info.ti.keyframe_frequency = this->keyint;
@@ -429,7 +430,7 @@
         av_seek_frame( this->context, -1, (int64_t)AV_TIME_BASE*this->start_time, 1);
 #endif
         /*check for end time and caclulate number of frames to encode*/
-        int no_frames = fps*(this->end_time - this->start_time);
+        no_frames = fps*(this->end_time - this->start_time);
         if(this->end_time > 0 && no_frames <= 0){
             fprintf(stderr,"end time has to be bigger than start time\n");
             exit(1);
@@ -763,9 +764,6 @@
     
     AVInputFormat *input_fmt = NULL;
     AVFormatParameters *formatParams = NULL;
-
-    ff2theora convert = ff2theora_init ();
-    av_register_all ();
     
     int c,long_option_index;
     const char *optstring = "o:f:x:y:v:V:a:A:S:K:d:H:c:p:N:s:e:D:h::";
@@ -811,6 +809,9 @@
       {NULL,0,NULL,0}
     };
 
+    ff2theora convert = ff2theora_init ();
+    av_register_all ();
+
     if (argc == 1){
         print_usage ();
     }
@@ -1052,7 +1053,6 @@
         formatParams->channel = 0;
         formatParams->width = 384;
         formatParams->height = 288;
-
         if(convert->picture_width)
             formatParams->width = convert->picture_width;
         if(convert->picture_height)
@@ -1061,11 +1061,12 @@
         formatParams->time_base.den = 25;
         formatParams->time_base.num = 1;
         if(convert->force_input_fps) {
+
             formatParams->time_base.den = convert->force_input_fps * 1000;
             formatParams->time_base.num = 1000;
+
         }
         formatParams->standard = "pal";        
-
         input_fmt = av_find_input_format("video4linux");
         sprintf(inputfile_name,"");
     }

Modified: trunk/ffmpeg2theora/theorautils.c
===================================================================
--- trunk/ffmpeg2theora/theorautils.c	2005-07-06 17:37:47 UTC (rev 9550)
+++ trunk/ffmpeg2theora/theorautils.c	2005-07-06 19:46:51 UTC (rev 9551)
@@ -67,9 +67,9 @@
 
     /* initialize Vorbis too, if we have audio. */
     if(!info->video_only){
+        int ret;
         vorbis_info_init (&info->vi);
         /* Encoding using a VBR quality mode.  */
-        int ret;
         if(info->vorbis_quality>-99) 
             ret =vorbis_encode_init_vbr (&info->vi, info->channels,info->sample_rate,info->vorbis_quality);
         else



More information about the commits mailing list