From 0db153b7b924e804e9ddf3f4f355922042c08e6f Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 25 Oct 2022 10:10:36 +0200 Subject: [PATCH] Make MP4 input more consistent and verbose in erroring out during initial read --- src/input/input_mp4.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/input/input_mp4.cpp b/src/input/input_mp4.cpp index 6a3f9a37..5eae18b6 100644 --- a/src/input/input_mp4.cpp +++ b/src/input/input_mp4.cpp @@ -268,6 +268,13 @@ namespace Mist{ } } + if (!hasMoov){ + FAIL_MSG("No MOOV box found in source file; aborting!"); + if (!inFile){FAIL_MSG("URIReader for source file was disconnected!");} + return false; + } + + // See whether a separate header file exists. if (readExistingHeader()){ bps = 0; @@ -278,11 +285,6 @@ namespace Mist{ INFO_MSG("Not read existing header"); meta.reInit(isSingular() ? streamName : ""); - if (!hasMoov){ - FAIL_MSG("No MOOV box found; aborting header creation!"); - return false; - } - tNumber = 0; // Create header file from MP4 data MP4::Box moovBox(readBuffer, false);