From 6f1260f87061bdf7a8ff2472e309d9635e5d770d Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Wed, 16 Mar 2011 23:37:16 +0100 Subject: [PATCH] matroskadec: set a default duration also for packets comming from a simple block --- libavformat/matroskadec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index b0451020c0..d0fe98df0c 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -486,7 +486,7 @@ static EbmlSyntax matroska_segments[] = { static EbmlSyntax matroska_blockgroup[] = { { MATROSKA_ID_BLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) }, { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) }, - { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock,duration), {.u=AV_NOPTS_VALUE} }, + { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock,duration) }, { MATROSKA_ID_BLOCKREFERENCE, EBML_UINT, 0, offsetof(MatroskaBlock,reference) }, { 1, EBML_UINT, 0, offsetof(MatroskaBlock,non_simple), {.u=1} }, { 0 } @@ -1622,7 +1622,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, st = track->stream; if (st->discard >= AVDISCARD_ALL) return res; - if (duration == AV_NOPTS_VALUE) + if (!duration) duration = track->default_duration / matroska->time_scale; block_time = AV_RB16(data);