[MPlayer-cvslog] r21404 - trunk/libmpdemux/ebml.c

reimar subversion at mplayerhq.hu
Thu Nov 30 18:55:00 CET 2006


Author: reimar
Date: Thu Nov 30 18:55:00 2006
New Revision: 21404

Modified:
   trunk/libmpdemux/ebml.c

Log:
Use av_int2flt/av_int2dbl to read float values. This is simpler and more
correct since it also works for int endianness != float endianness.


Modified: trunk/libmpdemux/ebml.c
==============================================================================
--- trunk/libmpdemux/ebml.c	(original)
+++ trunk/libmpdemux/ebml.c	Thu Nov 30 18:55:00 2006
@@ -13,6 +13,7 @@
 #include "ebml.h"
 #include "libavutil/common.h"
 #include "libavutil/bswap.h"
+#include "libavutil/intfloat_readwrite.h"
 
 
 #ifndef SIZE_MAX
@@ -179,20 +180,12 @@
   switch (len)
     {
     case 4:
-      {
-        union {uint32_t i; float f;} u;
-        u.i = stream_read_dword (s);
-        value = u.f;
+        value = av_int2flt(stream_read_dword(s));
         break;
-      }
 
     case 8:
-      {
-        union {uint64_t i; double d;} u;
-        u.i = stream_read_qword (s);
-        value = u.d;
+        value = av_int2dbl(stream_read_qword(s));
         break;
-      }
 
     default:
       return EBML_FLOAT_INVALID;



More information about the MPlayer-cvslog mailing list