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@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2015-11-09 23:49:25 +01:00
parent 8f60663c8b
commit ba9191ab3a
1 changed files with 2 additions and 7 deletions

View File

@ -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;