[FFmpeg-devel] [PATCH] do not let claculated dts jump back

Michael Niedermayer michaelni at gmx.at
Fri Feb 21 00:51:16 CET 2014


On Thu, Feb 20, 2014 at 07:10:40PM +0100, Rainer Hochecker wrote:
> ---
>  libavformat/utils.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index a8eb548..aac8c2d 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -1196,8 +1196,12 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
>          st->pts_buffer[0] = pkt->pts;
>          for (i = 0; i<delay && st->pts_buffer[i] > st->pts_buffer[i + 1]; i++)
>              FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]);
> -        if (pkt->dts == AV_NOPTS_VALUE)
> +        if (pkt->dts == AV_NOPTS_VALUE) {
>              pkt->dts = st->pts_buffer[0];
> +            // don't let calculated timestamps jump back
> +            if (pc->last_dts != AV_NOPTS_VALUE && pkt->dts < pc->last_dts)
> +            	pkt->dts = pc->last_dts;
> +        }
>      }
>      // We skipped it above so we try here.
>      if (st->codec->codec_id == AV_CODEC_ID_H264 ||

this segfaults with make fate

and where can i find a mpeg ts file that needs this ?


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140221/6f803650/attachment.asc>


More information about the ffmpeg-devel mailing list