[FFmpeg-devel] [PATCH 2/5] concatdec: calculate duration early if outpoint is known

Marton Balint cus at passwd.hu
Fri Nov 20 19:14:17 CET 2015


On Sat, 14 Nov 2015, Marton Balint wrote:

>
> On Fri, 13 Nov 2015, Nicolas George wrote:
>
>> Le decadi 20 brumaire, an CCXXIV, Marton Balint a écrit :
>>> Signed-off-by: Marton Balint <cus at passwd.hu>
>>> ---
>>>  libavformat/concatdec.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
>>> index 0180a7e..560aa64 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;
>>
>> Is it not already done? In read_header():
>>
>>        if (cat->files[i].duration == AV_NOPTS_VALUE) {
>>            if (cat->files[i].inpoint == AV_NOPTS_VALUE || 
> cat->files[i].outpoint == AV_NOPTS_VALUE)
>>                break;
>>            cat->files[i].duration = cat->files[i].outpoint - 
> cat->files[i].inpoint;
>>        }
>>
>> is done for every file, it seems it does exactly the same thing.
>
> In read_header, duration is only set if both inpoint and outpoint is set 
> by the user.
>
> In open_file duration is set if outpoint is set by the user which is 
> the superset of the first case.

Do you have any further questions? Can I apply the series?

Thanks
Marton


More information about the ffmpeg-devel mailing list