From 552240b52879b2c686889105cfb3ffd9ed91d7a5 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 15 Nov 2018 13:22:00 +0100 Subject: [PATCH 1/2] Make FLV input read until errors, instead of aborting entirely. --- lib/flv_tag.cpp | 2 ++ src/input/input_flv.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/flv_tag.cpp b/lib/flv_tag.cpp index c0c41275..4156374b 100644 --- a/lib/flv_tag.cpp +++ b/lib/flv_tag.cpp @@ -396,6 +396,8 @@ FLV::Tag::~Tag() { /// This operator checks for self-assignment. FLV::Tag & FLV::Tag::operator=(const FLV::Tag & O) { if (this != &O) { //no self-assignment + done = true; + sofar = 0; len = O.len; if (len > 0) { if (checkBufferSize()) { diff --git a/src/input/input_flv.cpp b/src/input/input_flv.cpp index d9a2264f..5ad77ebb 100644 --- a/src/input/input_flv.cpp +++ b/src/input/input_flv.cpp @@ -95,10 +95,12 @@ namespace Mist { bench = Util::getMicros(bench); INFO_MSG("Header generated in %llu ms: @%lld, %s, %s", bench/1000, lastBytePos, myMeta.vod?"VoD":"NOVoD", myMeta.live?"Live":"NOLive"); if (FLV::Parse_Error){ + tmpTag = FLV::Tag(); FLV::Parse_Error = false; ERROR_MSG("Stopping at FLV parse error @%lld: %s", lastBytePos, FLV::Error_Str.c_str()); } myMeta.toFile(config->getString("input") + ".dtsh"); + Util::fseek(inFile, 13, SEEK_SET); return true; } @@ -125,6 +127,7 @@ namespace Mist { } if (FLV::Parse_Error){ FLV::Parse_Error = false; + tmpTag = FLV::Tag(); FAIL_MSG("FLV error @ %lld: %s", lastBytePos, FLV::Error_Str.c_str()); thisPacket.null(); return; From 6cc94a28da039bc8fb67271f65941a338e925ab6 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 16 Nov 2018 15:04:33 +0100 Subject: [PATCH 2/2] Do not clear stream name when failing --- src/output/output.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/output/output.cpp b/src/output/output.cpp index 60049c71..f88718c1 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -139,7 +139,6 @@ namespace Mist{ isInitialized = false; wantRequest = true; parseData= false; - streamName.clear(); myConn.close(); }