From d9bda0c65afa2f967d3007f2a9924e5f938c58df Mon Sep 17 00:00:00 2001 From: Erik Zandvliet Date: Tue, 30 Apr 2013 12:20:11 +0200 Subject: [PATCH] Fixed fragmenting for non-video tracks. --- src/converters/dtscfix.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/converters/dtscfix.cpp b/src/converters/dtscfix.cpp index 40bf0f5d..2b05b055 100644 --- a/src/converters/dtscfix.cpp +++ b/src/converters/dtscfix.cpp @@ -10,9 +10,9 @@ namespace Converters { class HeaderEntryDTSC { public: - HeaderEntryDTSC() : totalSize(0), keyNum(0), trackID(0), firstms(-1), lastms(0), keynum(0) {} + HeaderEntryDTSC() : totalSize(0), lastKeyTime(-1000), trackID(0), firstms(-1), lastms(0), keynum(0) {} long long unsigned int totalSize; - long long int keyNum; + long long int lastKeyTime; long long int trackID; long long int firstms; long long int lastms; @@ -132,6 +132,16 @@ namespace Converters { meta["tracks"][currentID]["keylen"].append(F.getJSON()["time"].asInt() - meta["tracks"][currentID]["keytime"][meta["tracks"][currentID]["keytime"].size() - 2].asInt()); } } + }else{ + if ((F.getJSON()["time"].asInt() - trackData[currentID].lastKeyTime) > 1000){ + trackData[currentID].lastKeyTime = F.getJSON()["time"].asInt(); + meta["tracks"][currentID]["keytime"].append(F.getJSON()["time"]); + meta["tracks"][currentID]["keybpos"].append(F.getLastReadPos()); + meta["tracks"][currentID]["keynum"].append( ++trackData[currentID].keynum); + if (meta["tracks"][currentID]["keytime"].size() > 1){ + meta["tracks"][currentID]["keylen"].append(F.getJSON()["time"].asInt() - meta["tracks"][currentID]["keytime"][meta["tracks"][currentID]["keytime"].size() - 2].asInt()); + } + } } F.seekNext(); }