From 3383a53e7d0abb9639c3ea3481f0eda9dca61a26 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 27 Nov 2011 14:04:16 +0000 Subject: lavu: replace int/float punning functions The existing functions defined in intfloat_readwrite.[ch] are both slow and incorrect (infinities are not handled). This introduces a new header with fast, inline conversion functions using direct union punning assuming an IEEE-754 system, an assumption already made throughout the code. The one use of Intel/Motorola extended 80-bit format is replaced by simpler code sufficient under the present constraints (positive normal values). The old functions are marked deprecated and retained for compatibility. Signed-off-by: Mans Rullgard --- libavformat/wtv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavformat/wtv.c') diff --git a/libavformat/wtv.c b/libavformat/wtv.c index 0cef6fb240..e4b9ae573a 100644 --- a/libavformat/wtv.c +++ b/libavformat/wtv.c @@ -26,7 +26,7 @@ */ #include "libavutil/intreadwrite.h" -#include "libavutil/intfloat_readwrite.h" +#include "libavutil/intfloat.h" #include "libavutil/dict.h" #include "avformat.h" #include "internal.h" @@ -458,7 +458,7 @@ static void crazytime_to_iso8601(char *buf, int buf_size, int64_t value) */ static void oledate_to_iso8601(char *buf, int buf_size, int64_t value) { - time_t t = 631112400LL + 86400*av_int2dbl(value); + time_t t = 631112400LL + 86400*av_int2double(value); strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", gmtime(&t)); } @@ -523,7 +523,7 @@ static void get_tag(AVFormatContext *s, AVIOContext *pb, const char *key, int ty else if (!strcmp(key, "WM/WMRVExpirationDate")) oledate_to_iso8601(buf, buf_size, num); else if (!strcmp(key, "WM/WMRVBitrate")) - snprintf(buf, buf_size, "%f", av_int2dbl(num)); + snprintf(buf, buf_size, "%f", av_int2double(num)); else snprintf(buf, buf_size, "%"PRIi64, num); } else if (type == 5 && length == 2) { -- cgit v1.2.3