From 8f4ddf14d962eeef4925f0331ae0aab1d6a870d2 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Wed, 26 Jul 2017 10:38:20 +0200 Subject: [PATCH] Added header read speed timers, simplified header logic for VoD. --- src/input/input_av.cpp | 3 --- src/input/input_balancer.h | 1 + src/input/input_folder.h | 1 + src/input/input_hls.h | 1 + src/input/input_ismv.cpp | 2 -- src/input/input_mp4.h | 1 + src/input/input_ts.cpp | 9 +++++---- src/input/input_ts.h | 1 + 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/input/input_av.cpp b/src/input/input_av.cpp index 8c73b4d3..b25ea65c 100644 --- a/src/input/input_av.cpp +++ b/src/input/input_av.cpp @@ -93,9 +93,6 @@ namespace Mist { } bool inputAV::readHeader() { - //See whether a separate header file exists. - if (readExistingHeader()){return true;} - myMeta.tracks.clear(); for(unsigned int i=0; i < pFormatCtx->nb_streams; ){ AVStream * strm = pFormatCtx->streams[i++]; diff --git a/src/input/input_balancer.h b/src/input/input_balancer.h index 2ad5c668..6ed10087 100644 --- a/src/input/input_balancer.h +++ b/src/input/input_balancer.h @@ -9,6 +9,7 @@ namespace Mist { protected: bool checkArguments(){return false;}; bool readHeader(){return false;}; + bool needHeader(){return false;}; }; } diff --git a/src/input/input_folder.h b/src/input/input_folder.h index bbd8b846..9a0507c8 100644 --- a/src/input/input_folder.h +++ b/src/input/input_folder.h @@ -9,6 +9,7 @@ namespace Mist { protected: bool checkArguments(){return false;}; bool readHeader(){return false;}; + bool needHeader(){return false;}; }; } diff --git a/src/input/input_hls.h b/src/input/input_hls.h index ef5d2f57..9fe745ef 100644 --- a/src/input/input_hls.h +++ b/src/input/input_hls.h @@ -116,6 +116,7 @@ namespace Mist{ bool checkArguments(); bool preSetup(); bool readHeader(); + bool needHeader(){return true;} void getNext(bool smart = true); void seek(int seekTime); void trackSelect(std::string trackSpec); diff --git a/src/input/input_ismv.cpp b/src/input/input_ismv.cpp index e3045120..e85f5111 100644 --- a/src/input/input_ismv.cpp +++ b/src/input/input_ismv.cpp @@ -53,8 +53,6 @@ namespace Mist { if (!inFile) { return false; } - //See whether a separate header file exists. - if (readExistingHeader()){return true;} //parse ismv header fseek(inFile, 0, SEEK_SET); std::string ftyp; diff --git a/src/input/input_mp4.h b/src/input/input_mp4.h index 43d2ab0e..f415eb61 100644 --- a/src/input/input_mp4.h +++ b/src/input/input_mp4.h @@ -87,6 +87,7 @@ namespace Mist { bool checkArguments(); bool preRun(); bool readHeader(); + bool needHeader(){return true;} void getNext(bool smart = true); void seek(int seekTime); void trackSelect(std::string trackSpec); diff --git a/src/input/input_ts.cpp b/src/input/input_ts.cpp index cfd1c9ed..4e2cbf1e 100755 --- a/src/input/input_ts.cpp +++ b/src/input/input_ts.cpp @@ -218,6 +218,11 @@ namespace Mist { } + bool inputTS::needHeader(){ + if (!standAlone){return false;} + return Input::needHeader(); + } + ///Reads headers from a TS stream, and saves them into metadata ///It works by going through the entire TS stream, and every time ///It encounters a new PES start, it writes the currently found PES data @@ -225,11 +230,7 @@ namespace Mist { ///it writes the remaining metadata. ///\todo Find errors, perhaps parts can be made more modular bool inputTS::readHeader() { - if (!standAlone){return true;} if (!inFile){return false;} - //See whether a separate header file exists. - if (readExistingHeader()){return true;} - TS::Packet packet;//to analyse and extract data fseek(inFile, 0, SEEK_SET);//seek to beginning diff --git a/src/input/input_ts.h b/src/input/input_ts.h index 74d254a5..e9ab3237 100755 --- a/src/input/input_ts.h +++ b/src/input/input_ts.h @@ -19,6 +19,7 @@ namespace Mist { bool checkArguments(){return true;} bool preRun(); bool readHeader(); + bool needHeader(); void getNext(bool smart = true); void seek(int seekTime); void trackSelect(std::string trackSpec);