]> git.sesse.net Git - ffmpeg/blobdiff - ffmpeg.c
lavu: add thread message API.
[ffmpeg] / ffmpeg.c
index 4c738caadc903308fd499623b492edb00f991d44..5299f0ef0f08b8e04eaced7d3c377e079418fdbc 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -658,12 +658,8 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
         pkt->dts = max;
       }
     }
-    ost->last_mux_dts_plus_duration =
     ost->last_mux_dts = pkt->dts;
 
-    if (ost->last_mux_dts_plus_duration != AV_NOPTS_VALUE)
-        ost->last_mux_dts_plus_duration += pkt->duration;
-
     ost->data_size += pkt->size;
     ost->packets_written++;
 
@@ -1107,7 +1103,7 @@ static void do_video_stats(OutputStream *ost, int frame_size)
 
         fprintf(vstats_file,"f_size= %6d ", frame_size);
         /* compute pts value */
-        ti1 = ost->last_mux_dts_plus_duration * av_q2d(enc->time_base);
+        ti1 = av_stream_get_end_pts(ost->st) * av_q2d(ost->st->time_base);
         if (ti1 < 0.01)
             ti1 = 0.01;
 
@@ -1419,8 +1415,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
             vid = 1;
         }
         /* compute min output value */
-        if (ost->last_mux_dts_plus_duration != AV_NOPTS_VALUE)
-            pts = FFMAX(pts, av_rescale_q(ost->last_mux_dts_plus_duration,
+        if (av_stream_get_end_pts(ost->st) != AV_NOPTS_VALUE)
+            pts = FFMAX(pts, av_rescale_q(av_stream_get_end_pts(ost->st),
                                           ost->st->time_base, AV_TIME_BASE_Q));
     }
 
@@ -2377,6 +2373,9 @@ static void set_encoder_id(OutputFile *of, OutputStream *ost)
     int format_flags = 0;
     int codec_flags = 0;
 
+    if (av_dict_get(ost->st->metadata, "encoder",  NULL, 0))
+        return;
+
     e = av_dict_get(of->opts, "fflags", NULL, 0);
     if (e) {
         const AVOption *o = av_opt_find(of->ctx, "fflags", NULL, 0, 0);
@@ -3180,7 +3179,7 @@ static int init_input_threads(void)
     for (i = 0; i < nb_input_files; i++) {
         InputFile *f = input_files[i];
 
-        if (!(f->fifo = av_fifo_alloc(8*sizeof(AVPacket))))
+        if (!(f->fifo = av_fifo_alloc_array(8, sizeof(AVPacket))))
             return AVERROR(ENOMEM);
 
         if (f->ctx->pb ? !f->ctx->pb->seekable :