aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2015-10-24 16:20:41 +0200
committerMarton Balint <cus@passwd.hu>2015-11-25 00:34:29 +0100
commit8f60663c8b71306b4d3e4e41275c3548848af2d7 (patch)
treea99da751555ea8500dabd79df67afbfb2ddc7a1d /libavformat
parent4ea4d2f438c9a7eba37980c9a87be4b34943e4d5 (diff)
downloadffmpeg-8f60663c8b71306b4d3e4e41275c3548848af2d7.tar.gz
concatdec: calculate duration early if outpoint is known
Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/concatdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 0180a7e50f..560aa643cf 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -316,6 +316,8 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
cat->files[fileno - 1].duration;
file->file_start_time = (cat->avf->start_time == AV_NOPTS_VALUE) ? 0 : cat->avf->start_time;
file->file_inpoint = (file->inpoint == AV_NOPTS_VALUE) ? file->file_start_time : file->inpoint;
+ if (file->duration == AV_NOPTS_VALUE && file->outpoint != AV_NOPTS_VALUE)
+ file->duration = file->outpoint - file->file_inpoint;
if ((ret = match_streams(avf)) < 0)
return ret;
if (file->inpoint != AV_NOPTS_VALUE) {