From 7f98ba24c7ffb026544a0c400e9d8a34ed955782 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 24 Dec 2008 11:56:53 +0100 Subject: [PATCH] ffmpeg: case AV_NOPTS_VALUE to int64_t The old code casted it to a 32 bit integer, which cut off bits. AVFormatContext.duration is a int64_t, so use this type. --- src/decoder/ffmpeg_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c index d1e17885a..7f7978b9d 100644 --- a/src/decoder/ffmpeg_plugin.c +++ b/src/decoder/ffmpeg_plugin.c @@ -279,7 +279,7 @@ ffmpeg_decode_internal(struct ffmpeg_context *ctx) } //there is some problem with this on some demux (mp3 at least) - if (format_context->duration != (int)AV_NOPTS_VALUE) { + if (format_context->duration != (int64_t)AV_NOPTS_VALUE) { total_time = format_context->duration / AV_TIME_BASE; } @@ -330,7 +330,7 @@ static bool ffmpeg_tag_internal(struct ffmpeg_context *ctx) const AVFormatContext *f = ctx->format_context; tag->time = 0; - if (f->duration != (int)AV_NOPTS_VALUE) + if (f->duration != (int64_t)AV_NOPTS_VALUE) tag->time = f->duration / AV_TIME_BASE; if (f->author[0]) tag_add_item(tag, TAG_ITEM_ARTIST, f->author);