Commit 98a7d560 authored by John Stebbins's avatar John Stebbins Committed by Luca Barbato

matroskadec: set default duration for simple block

When a normal Block is parsed, duration is initialized to
AV_NOPTS_VALUE.  If it is not changed, then the track's default
duration is used.  But for SimpleBlock, duration is initialized to
0 instead of AV_NOPTS_VALUE.  This is due to the difference in how
EBML_NEST vs EBML_PASS are processed.  Setting duration to 0 leads
eventually to wrongly estimate the frame duration in util.c
Signed-off-by: default avatarLuca Barbato <>
parent 5666a9f2
......@@ -1852,6 +1852,8 @@ static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
for (i=0; i<blocks_list->nb_elem; i++)
if (blocks[i].bin.size > 0 && blocks[i] {
int is_keyframe = blocks[i].non_simple ? !blocks[i].reference : -1;
if (!blocks[i].non_simple)
blocks[i].duration = AV_NOPTS_VALUE;
blocks[i], blocks[i].bin.size,
blocks[i].bin.pos, cluster.timecode,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment