Le tridi 3 brumaire, an CCXXIV, Marton Balint a écrit : > Signed-off-by: Marton Balint <[email protected]> > --- > libavformat/concatdec.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c > index 7686f28..f262d44 100644 > --- a/libavformat/concatdec.c > +++ b/libavformat/concatdec.c > @@ -316,6 +316,14 @@ 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->duration = cat->avf->duration;
> + if (file->inpoint != AV_NOPTS_VALUE)
> + file->duration -= (file->inpoint - file->file_start_time);
> + if (file->outpoint != AV_NOPTS_VALUE)
> + file->duration -= cat->avf->duration - (file->outpoint -
> file->file_start_time);
> + }
At this point, the file duration is not reliable, so unless I am mistaken
this change would produce wrong timestamps when stitching, for example, MP3
files without extra headers.
> +
> if ((ret = match_streams(avf)) < 0)
> return ret;
> if (file->inpoint != AV_NOPTS_VALUE) {
> @@ -469,14 +477,6 @@ 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 (++fileno >= cat->nb_files) {
> cat->eof = 1;
> return AVERROR_EOF;
Regards,
--
Nicolas George
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
