diff options
author | Mans Rullgard <mans@mansr.com> | 2011-11-27 14:04:16 +0000 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-12-11 18:47:19 +0000 |
commit | 3383a53e7d0abb9639c3ea3481f0eda9dca61a26 (patch) | |
tree | d53f0c38d95d4256b727dc4f4c5add488aabe501 /libavformat/wtv.c | |
parent | 5b3265a7181889b53ff8217c1bdccdf966c86955 (diff) |
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 <mans@mansr.com>
Diffstat (limited to 'libavformat/wtv.c')
-rw-r--r-- | libavformat/wtv.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |