decoder/ffmpeg: ignore negative time stamps

Works around assertion failure in decoder_timestamp().
This commit is contained in:
Max Kellermann
2012-10-05 16:35:45 +02:00
parent fd016f4507
commit e39382dedd
2 changed files with 3 additions and 1 deletions

View File

@@ -273,7 +273,7 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
AVCodecContext *codec_context,
const AVRational *time_base)
{
if (packet->pts != (int64_t)AV_NOPTS_VALUE)
if (packet->pts >= 0 && packet->pts != (int64_t)AV_NOPTS_VALUE)
decoder_timestamp(decoder,
time_from_ffmpeg(packet->pts, *time_base));