Revision 8baa6614 libavformat/4xm.c

View differences:

libavformat/4xm.c
75 75
    float fps;
76 76
} FourxmDemuxContext;
77 77

  
78
static float get_le_float(unsigned char *buffer)
79
{
80
    float f;
81
    unsigned char *float_buffer = (unsigned char *)&f;
82

  
83
#ifdef WORDS_BIGENDIAN
84
    float_buffer[0] = buffer[3];
85
    float_buffer[1] = buffer[2];
86
    float_buffer[2] = buffer[1];
87
    float_buffer[3] = buffer[0];
88
#else
89
    float_buffer[0] = buffer[0];
90
    float_buffer[1] = buffer[1];
91
    float_buffer[2] = buffer[2];
92
    float_buffer[3] = buffer[3];
93
#endif
94

  
95
    return f;
96
}
97

  
98 78
static int fourxm_probe(AVProbeData *p)
99 79
{
100 80
    if (p->buf_size < 12)
......
147 127
        size = LE_32(&header[i + 4]);
148 128

  
149 129
        if (fourcc_tag == std__TAG) {
150
            fourxm->fps = get_le_float(&header[i + 12]);
130
            fourxm->fps = av_int2flt(LE_32(&header[i + 12]));
151 131
        } else if (fourcc_tag == vtrk_TAG) {
152 132
            /* check that there is enough data */
153 133
            if (size != vtrk_SIZE) {

Also available in: Unified diff