Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2010-08-14 14:41:00 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2010-08-14 14:41:00 +0400
commitb2fcb5ec20a3a32a7f1771a14d06e63b045f9126 (patch)
treefc5347d870e93d116a8e6043bac4a1eef0384ba5
parent6d841f0b6edb0b6b048ebc8366bb4b78dfb774db (diff)
Small cleanups in timestamp conversion.0.2
-rw-r--r--src/LAVFSplitter/LAVFSplitter.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/LAVFSplitter/LAVFSplitter.cpp b/src/LAVFSplitter/LAVFSplitter.cpp
index d1b939b9..c2d42c6b 100644
--- a/src/LAVFSplitter/LAVFSplitter.cpp
+++ b/src/LAVFSplitter/LAVFSplitter.cpp
@@ -362,12 +362,10 @@ REFERENCE_TIME CLAVFSplitter::ConvertTimestampToRT(int64_t pts, int num, int den
return Packet::INVALID_TIME;
}
- // do calculations in double-precision floats as they can easily overflow otherwise
- // we don't care for having a completly exact timestamp anyway
+ // Let av_rescale do the work, its smart enough to not overflow
REFERENCE_TIME timestamp = av_rescale(pts, (int64_t)num * DVD_TIME_BASE, den);
- REFERENCE_TIME starttime = 0;
- if (m_avFormat->start_time != (int64_t)AV_NOPTS_VALUE && m_avFormat->start_time != 0) {
+ if (m_avFormat->start_time != (int64_t)AV_NOPTS_VALUE && m_avFormat->start_time != 0) {
timestamp -= av_rescale(m_avFormat->start_time, DVD_TIME_BASE, AV_TIME_BASE);
}
@@ -382,7 +380,7 @@ int64_t CLAVFSplitter::ConvertRTToTimestamp(REFERENCE_TIME timestamp, int num, i
return (int64_t)AV_NOPTS_VALUE;
}
- double starttime = 0.0f;
+ // Let av_rescale do the work, its smart enough to not overflow
if (m_avFormat->start_time != (int64_t)AV_NOPTS_VALUE && m_avFormat->start_time != 0) {
timestamp += av_rescale(m_avFormat->start_time, DVD_TIME_BASE, AV_TIME_BASE);
}