[FFmpeg-devel] [PATCH 2/5] concatdec: calculate duration early if outpoint is known
Nicolas George
george at nsup.org
Fri Nov 13 16:07:12 CET 2015
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.
> if ((ret = match_streams(avf)) < 0)
> return ret;
> if (file->inpoint != AV_NOPTS_VALUE) {
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151113/43b90f23/attachment.sig>
More information about the ffmpeg-devel
mailing list