From 5247319775ce71e2494fea97b7d30403e0244db3 Mon Sep 17 00:00:00 2001 From: Henrik Gramner Date: Thu, 8 Sep 2022 19:56:05 +0200 Subject: tools: Improve demuxer probing Increase the probing size, and change the logic to assume a stream is valid even if no conclusive decision could be made within the probing window as long as a sequence header was detected. --- tools/input/annexb.c | 6 +++--- tools/input/section5.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/input/annexb.c b/tools/input/annexb.c index 7c7d4e3..8add61c 100644 --- a/tools/input/annexb.c +++ b/tools/input/annexb.c @@ -43,7 +43,7 @@ // these functions are based on an implementation from FFmpeg, and relicensed // with author's permission -#define PROBE_SIZE 1024 +#define PROBE_SIZE 2048 static int annexb_probe(const uint8_t *data) { int ret, cnt = 0; @@ -113,10 +113,10 @@ static int annexb_probe(const uint8_t *data) { temporal_unit_size -= obu_unit_size; frame_unit_size -= obu_unit_size; if (frame_unit_size <= 0) - break; + return 0; } - return 0; + return seq; } typedef struct DemuxerPriv { diff --git a/tools/input/section5.c b/tools/input/section5.c index b7cc203..db1b34c 100644 --- a/tools/input/section5.c +++ b/tools/input/section5.c @@ -39,7 +39,7 @@ #include "input/demuxer.h" #include "input/parse.h" -#define PROBE_SIZE 1024 +#define PROBE_SIZE 2048 static int section5_probe(const uint8_t *data) { int ret, cnt = 0; @@ -77,7 +77,7 @@ static int section5_probe(const uint8_t *data) { } } - return 0; + return seq; } typedef struct DemuxerPriv { -- cgit v1.2.3