Merge branch 'development' into LTS_development
This commit is contained in:
commit
69d2ca21d3
5 changed files with 48 additions and 5 deletions
|
@ -52,7 +52,7 @@ namespace Mist{
|
|||
if (finished){
|
||||
return (ctr - rem > 0);
|
||||
}else{
|
||||
return (ctr - rem > 12);
|
||||
return frameOffsetKnown ? (ctr - rem > 1) : (ctr - rem > 12);
|
||||
}
|
||||
}
|
||||
/// Clears all internal values, for reuse as-new.
|
||||
|
@ -76,6 +76,11 @@ namespace Mist{
|
|||
}else{
|
||||
if (rem && !p.key){
|
||||
p.offset = p.time + maxEBMLFrameOffset - (lastTime + smallestFrame);
|
||||
if (p.offset > (maxEBMLFrameOffset + frameOffset + smallestFrame)){
|
||||
uint64_t diff = p.offset - (maxEBMLFrameOffset + frameOffset + smallestFrame);
|
||||
p.offset -= diff;
|
||||
lastTime += diff;
|
||||
}
|
||||
//If we calculate an offset less than a frame away,
|
||||
//we assume it's just time stamp drift due to lack of precision.
|
||||
p.time = (lastTime + smallestFrame);
|
||||
|
@ -96,15 +101,16 @@ namespace Mist{
|
|||
}
|
||||
if (isVideo && ctr && ctr >= rem){
|
||||
int32_t currOffset = packTime - pkts[(ctr-1)%PKT_COUNT].time;
|
||||
if (!frameOffsetKnown && currOffset < 0 && -currOffset < 8 * smallestFrame &&
|
||||
-currOffset * 2 > maxEBMLFrameOffset && ctr < PKT_COUNT / 2){
|
||||
maxEBMLFrameOffset = -currOffset * 2;
|
||||
INFO_MSG("Max frame offset is now %u", maxEBMLFrameOffset);
|
||||
}
|
||||
if (currOffset < 0){currOffset *= -1;}
|
||||
if (!smallestFrame || currOffset < smallestFrame){
|
||||
smallestFrame = currOffset;
|
||||
HIGH_MSG("Smallest frame is now %u", smallestFrame);
|
||||
}
|
||||
if (!frameOffsetKnown && currOffset < 8*smallestFrame && currOffset*2 > maxEBMLFrameOffset && ctr < PKT_COUNT/2){
|
||||
maxEBMLFrameOffset = currOffset*2;
|
||||
INFO_MSG("Max frame offset is now %u", maxEBMLFrameOffset);
|
||||
}
|
||||
}
|
||||
DONTEVEN_MSG("Ingesting %llu (%llu -> %llu)", packTime, ctr, ctr % PKT_COUNT);
|
||||
pkts[ctr % PKT_COUNT].set(packTime, packOffset, packTrack, packDataSize, packBytePos, isKeyframe, dataPtr);
|
||||
|
|
|
@ -108,6 +108,7 @@ namespace Mist{
|
|||
/// Calculates the size of a Cluster (contents only) and returns it.
|
||||
/// Bases the calculation on the currently selected tracks and the given start/end time for the cluster.
|
||||
uint32_t OutEBML::clusterSize(uint64_t start, uint64_t end){
|
||||
if (start == end){++end;}
|
||||
uint32_t sendLen = EBML::sizeElemUInt(EBML::EID_TIMECODE, start);
|
||||
for (std::set<long unsigned int>::iterator it = selectedTracks.begin();
|
||||
it != selectedTracks.end(); it++){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue