From e4258bfad3e18a60e2f3faa44b13fdfdfac0b2cf Mon Sep 17 00:00:00 2001 From: Joseph Wallace Date: Fri, 20 Nov 2015 14:27:00 -0500 Subject: [PATCH] Don't wait for video keyframes on audio-only streams. --- src/format_ebml.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/format_ebml.c b/src/format_ebml.c index 9ae48b9e..3e613596 100644 --- a/src/format_ebml.c +++ b/src/format_ebml.c @@ -481,8 +481,13 @@ static int ebml_read(ebml_t *ebml, char *buffer, int len, ebml_chunk_type *chunk if (ebml->cluster_start == 0) { /* new cluster is starting now */ - if (ebml->cluster_starts_with_keyframe == EBML_KEYFRAME_STARTS_CLUSTER) { - /* Successfully found a keyframe in this cluster's video track */ + if (ebml->cluster_starts_with_keyframe != EBML_KEYFRAME_DOES_NOT_START_CLUSTER) { + /* If we positively identified the first video frame as a non-keyframe, + * don't use this cluster as a sync point. Since some files lack + * video tracks completely, or we may have failed to probe + * the first video frame, it's better to be pass through + * ambiguous cases to avoid blocking the stream forever. + */ *chunk_type = EBML_CHUNK_CLUSTER_START; }