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/mov.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat/mov.c') diff --git a/libavformat/mov.c b/libavformat/mov.c index eef53e6d66..d9fb8fb991 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -26,7 +26,7 @@ //#define MOV_EXPORT_ALL_METADATA #include "libavutil/intreadwrite.h" -#include "libavutil/intfloat_readwrite.h" +#include "libavutil/intfloat.h" #include "libavutil/mathematics.h" #include "libavutil/avstring.h" #include "libavutil/dict.h" @@ -1218,7 +1218,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) avio_rb32(pb); /* bytes per sample */ } else if (version==2) { avio_rb32(pb); /* sizeof struct only */ - st->codec->sample_rate = av_int2dbl(avio_rb64(pb)); /* float 64 */ + st->codec->sample_rate = av_int2double(avio_rb64(pb)); /* float 64 */ st->codec->channels = avio_rb32(pb); avio_rb32(pb); /* always 0x7F000000 */ st->codec->bits_per_coded_sample = avio_rb32(pb); /* bits per channel if sound is uncompressed */ -- cgit v1.2.3