精确mp4录制时长:#1795

This commit is contained in:
ziyue
2022-10-16 16:40:21 +08:00
parent bbdcc44eb0
commit 80eef693c6
3 changed files with 23 additions and 11 deletions

View File

@@ -61,6 +61,16 @@ bool MP4MuxerInterface::haveVideo() const {
return _have_video;
}
uint64_t MP4MuxerInterface::getDuration() const {
uint64_t ret = 0;
for (auto &pr : _codec_to_trackid) {
if (pr.second.stamp.getRelativeStamp() > ret) {
ret = pr.second.stamp.getRelativeStamp();
}
}
return ret;
}
void MP4MuxerInterface::resetTracks() {
_started = false;
_have_video = false;