[FFmpeg-cvslog] seektest: floatfree
Michael Niedermayer
git at videolan.org
Sun Dec 11 19:23:03 CET 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 11 19:21:39 2011 +0100| [16abd687798bbf9192ba4954765e61de96065b8b] | committer: Michael Niedermayer
seektest: floatfree
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=16abd687798bbf9192ba4954765e61de96065b8b
---
libavformat/seek-test.c | 5 ++---
tests/ref/seek/lavf_wtv | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/libavformat/seek-test.c b/libavformat/seek-test.c
index ec88a0b..519f949 100644
--- a/libavformat/seek-test.c
+++ b/libavformat/seek-test.c
@@ -48,13 +48,12 @@ static const char *ret_str(int v)
static void ts_str(char buffer[60], int64_t ts, AVRational base)
{
- double tsval;
if (ts == AV_NOPTS_VALUE) {
strcpy(buffer, " NOPTS ");
return;
}
- tsval = ts * av_q2d(base);
- snprintf(buffer, 60, "%9f", tsval);
+ ts= av_rescale_q(ts, base, (AVRational){1, 1000000});
+ snprintf(buffer, 60, "%c%Ld.%06Ld", ts<0 ? '-' : ' ', FFABS(ts)/1000000, FFABS(ts)%1000000);
}
int main(int argc, char **argv)
diff --git a/tests/ref/seek/lavf_wtv b/tests/ref/seek/lavf_wtv
index b532e59..2d6b95c 100644
--- a/tests/ref/seek/lavf_wtv
+++ b/tests/ref/seek/lavf_wtv
@@ -3,7 +3,7 @@ ret: 0 st:-1 flags:0 ts:-1.000000
ret: 0 st: 0 flags:1 dts: NOPTS pts: 0.000000 pos: 2144 size: 24801
ret:-1 st:-1 flags:1 ts: 1.894167
ret: 0 st: 0 flags:0 ts: 0.788334
-ret: 0 st: 1 flags:1 dts: 0.783673 pts: 0.783673 pos: 321176 size: 209
+ret: 0 st: 1 flags:1 dts: 0.783674 pts: 0.783674 pos: 321176 size: 209
ret: 0 st: 0 flags:1 ts:-0.317499
ret: 0 st: 0 flags:1 dts: NOPTS pts: 0.000000 pos: 2144 size: 24801
ret:-1 st: 1 flags:0 ts: 2.576668
More information about the ffmpeg-cvslog
mailing list