]> git.sesse.net Git - ffmpeg/blobdiff - avconv.c
x86: ac3dsp: Only refer to the ac3_downmix_sse symbol if it has been declared
[ffmpeg] / avconv.c
index 2566a92c14112c40380da915a21885308452afe9..ea736066ecb4e9516de8e472e9b0d4b7f82dc961 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -183,6 +183,7 @@ void exit_program(int ret)
 
         av_freep(&output_streams[i]->forced_keyframes);
         av_freep(&output_streams[i]->avfilter);
+        av_freep(&output_streams[i]->logfile_prefix);
         av_freep(&output_streams[i]->filtered_frame);
         av_freep(&output_streams[i]);
     }
@@ -719,7 +720,7 @@ static int poll_filter(OutputStream *ost)
  */
 static int poll_filters(void)
 {
-    int i, ret = 0;
+    int i, j, ret = 0;
 
     while (ret >= 0 && !received_sigterm) {
         OutputStream *ost = NULL;
@@ -746,10 +747,14 @@ static int poll_filters(void)
         ret = poll_filter(ost);
 
         if (ret == AVERROR_EOF) {
+            OutputFile *of = output_files[ost->file_index];
+
             ost->finished = 1;
 
-            if (opt_shortest)
-                return ret;
+            if (of->shortest) {
+                for (j = 0; j < of->ctx->nb_streams; j++)
+                    output_streams[of->ost_index + j]->finished = 1;
+            }
 
             ret = 0;
         } else if (ret == AVERROR(EAGAIN))
@@ -820,7 +825,7 @@ static void print_report(int is_last_report, int64_t timer_start)
                 if (qp >= 0 && qp < FF_ARRAY_ELEMS(qp_histogram))
                     qp_histogram[qp]++;
                 for (j = 0; j < 32; j++)
-                    snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%X", (int)lrintf(log(qp_histogram[j] + 1) / log(2)));
+                    snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%X", (int)lrintf(log2(qp_histogram[j] + 1)));
             }
             if (enc->flags&CODEC_FLAG_PSNR) {
                 int j;
@@ -1678,7 +1683,11 @@ static int transcode_init(void)
                 (video_sync_method ==  VSYNC_CFR ||
                  (video_sync_method ==  VSYNC_AUTO &&
                   !(oc->oformat->flags & (AVFMT_NOTIMESTAMPS | AVFMT_VARIABLE_FPS))))) {
-                ost->frame_rate = ist->st->avg_frame_rate.num ? ist->st->avg_frame_rate : (AVRational){25, 1};
+                ost->frame_rate = ist->framerate.num ? ist->framerate :
+                                  ist->st->avg_frame_rate.num ?
+                                  ist->st->avg_frame_rate :
+                                  (AVRational){25, 1};
+
                 if (ost->enc && ost->enc->supported_framerates && !ost->force_fps) {
                     int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates);
                     ost->frame_rate = ost->enc->supported_framerates[idx];
@@ -1739,7 +1748,8 @@ static int transcode_init(void)
                 FILE *f;
 
                 snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
-                         pass_logfilename_prefix ? pass_logfilename_prefix : DEFAULT_PASS_LOGFILENAME_PREFIX,
+                         ost->logfile_prefix ? ost->logfile_prefix :
+                                               DEFAULT_PASS_LOGFILENAME_PREFIX,
                          i);
                 if (!strcmp(ost->enc->name, "libx264")) {
                     av_dict_set(&ost->opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
@@ -2170,10 +2180,7 @@ static int process_input(void)
             }
         }
 
-        if (opt_shortest)
-            return AVERROR_EOF;
-        else
-            return AVERROR(EAGAIN);
+        return AVERROR(EAGAIN);
     }
 
     reset_eagain();
@@ -2391,7 +2398,7 @@ static void parse_cpuflags(int argc, char **argv, const OptionDef *options)
 {
     int idx = locate_option(argc, argv, options, "cpuflags");
     if (idx && argv[idx + 1])
-        opt_cpuflags("cpuflags", argv[idx + 1]);
+        opt_cpuflags(NULL, "cpuflags", argv[idx + 1]);
 }
 
 int main(int argc, char **argv)
@@ -2431,11 +2438,6 @@ int main(int argc, char **argv)
         exit_program(1);
     }
 
-    if (nb_input_files == 0) {
-        av_log(NULL, AV_LOG_FATAL, "At least one input file must be specified\n");
-        exit_program(1);
-    }
-
     ti = getutime();
     if (transcode() < 0)
         exit_program(1);