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/soxenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavformat/soxenc.c') diff --git a/libavformat/soxenc.c b/libavformat/soxenc.c index b89203c542..55d5bd98c0 100644 --- a/libavformat/soxenc.c +++ b/libavformat/soxenc.c @@ -30,7 +30,7 @@ */ #include "libavutil/intreadwrite.h" -#include "libavutil/intfloat_readwrite.h" +#include "libavutil/intfloat.h" #include "libavutil/dict.h" #include "avformat.h" #include "avio_internal.h" @@ -59,14 +59,14 @@ static int sox_write_header(AVFormatContext *s) ffio_wfourcc(pb, ".SoX"); avio_wl32(pb, sox->header_size); avio_wl64(pb, 0); /* number of samples */ - avio_wl64(pb, av_dbl2int(enc->sample_rate)); + avio_wl64(pb, av_double2int(enc->sample_rate)); avio_wl32(pb, enc->channels); avio_wl32(pb, comment_size); } else if (enc->codec_id == CODEC_ID_PCM_S32BE) { ffio_wfourcc(pb, "XoS."); avio_wb32(pb, sox->header_size); avio_wb64(pb, 0); /* number of samples */ - avio_wb64(pb, av_dbl2int(enc->sample_rate)); + avio_wb64(pb, av_double2int(enc->sample_rate)); avio_wb32(pb, enc->channels); avio_wb32(pb, comment_size); } else { -- cgit v1.2.1