[FFmpeg-cvslog] concatdec: simplify duration calculation in open_next_file

Marton Balint git at videolan.org
Wed Nov 25 01:05:46 CET 2015


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Mon Nov  9 23:49:25 2015 +0100| [ba9191ab3a51e2127ecf915dc0d803500b7cbcf0] | committer: Marton Balint

concatdec: simplify duration calculation in open_next_file

If duration is still AV_NOPTS_VALUE when opening the next file, we can assume
that outpoint is not set.

Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba9191ab3a51e2127ecf915dc0d803500b7cbcf0
---

 libavformat/concatdec.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 560aa64..1693941 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -471,13 +471,8 @@ static int open_next_file(AVFormatContext *avf)
     ConcatContext *cat = avf->priv_data;
     unsigned fileno = cat->cur_file - cat->files;
 
-    if (cat->cur_file->duration == AV_NOPTS_VALUE) {
-        cat->cur_file->duration = cat->avf->duration;
-        if (cat->cur_file->inpoint != AV_NOPTS_VALUE)
-            cat->cur_file->duration -= (cat->cur_file->inpoint - cat->cur_file->file_start_time);
-        if (cat->cur_file->outpoint != AV_NOPTS_VALUE)
-            cat->cur_file->duration -= cat->avf->duration - (cat->cur_file->outpoint - cat->cur_file->file_start_time);
-    }
+    if (cat->cur_file->duration == AV_NOPTS_VALUE)
+        cat->cur_file->duration = cat->avf->duration - (cat->cur_file->file_inpoint - cat->cur_file->file_start_time);
 
     if (++fileno >= cat->nb_files) {
         cat->eof = 1;



More information about the ffmpeg-cvslog mailing list