diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-07-19 15:32:43 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-07-19 15:32:43 +0000 |
commit | 8baa661498e5c7846088721a2e686d9a521da0db (patch) | |
tree | 4253222f44d160f102ac233203bd27e875fd90d8 /libavformat/4xm.c | |
parent | 7cb8f314db095715698329fafae5eadeb5504610 (diff) | |
download | ffmpeg-8baa661498e5c7846088721a2e686d9a521da0db.tar.gz |
more non portable float parsing code ...
Originally committed as revision 4462 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r-- | libavformat/4xm.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c index d4a8036469..6826511fcb 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -75,26 +75,6 @@ typedef struct FourxmDemuxContext { float fps; } FourxmDemuxContext; -static float get_le_float(unsigned char *buffer) -{ - float f; - unsigned char *float_buffer = (unsigned char *)&f; - -#ifdef WORDS_BIGENDIAN - float_buffer[0] = buffer[3]; - float_buffer[1] = buffer[2]; - float_buffer[2] = buffer[1]; - float_buffer[3] = buffer[0]; -#else - float_buffer[0] = buffer[0]; - float_buffer[1] = buffer[1]; - float_buffer[2] = buffer[2]; - float_buffer[3] = buffer[3]; -#endif - - return f; -} - static int fourxm_probe(AVProbeData *p) { if (p->buf_size < 12) @@ -147,7 +127,7 @@ static int fourxm_read_header(AVFormatContext *s, size = LE_32(&header[i + 4]); if (fourcc_tag == std__TAG) { - fourxm->fps = get_le_float(&header[i + 12]); + fourxm->fps = av_int2flt(LE_32(&header[i + 12])); } else if (fourcc_tag == vtrk_TAG) { /* check that there is enough data */ if (size != vtrk_SIZE) { |