Revision 7cb8f314

View differences:

libavformat/avio.h
104 104
void put_be16(ByteIOContext *s, unsigned int val);
105 105
void put_tag(ByteIOContext *s, const char *tag);
106 106

  
107
void put_be64_double(ByteIOContext *s, double val);
108 107
void put_strz(ByteIOContext *s, const char *buf);
109 108

  
110 109
offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence);
......
132 131
uint64_t get_le64(ByteIOContext *s);
133 132
unsigned int get_le16(ByteIOContext *s);
134 133

  
135
double get_be64_double(ByteIOContext *s);
136 134
char *get_strz(ByteIOContext *s, char *buf, int maxlen);
137 135
unsigned int get_be16(ByteIOContext *s);
138 136
unsigned int get_be24(ByteIOContext *s);
libavformat/aviobuf.c
210 210
    put_byte(s, val);
211 211
}
212 212

  
213
/* IEEE format is assumed */
214
void put_be64_double(ByteIOContext *s, double val)
215
{
216
    union {
217
        double d;
218
        uint64_t ull;
219
    } u;
220
    u.d = val;
221
    put_be64(s, u.ull);
222
}
223

  
224 213
void put_strz(ByteIOContext *s, const char *str)
225 214
{
226 215
    if (str)
......
449 438
    return val;
450 439
}
451 440

  
452
double get_be64_double(ByteIOContext *s)
453
{
454
    union {
455
        double d;
456
        uint64_t ull;
457
    } u;
458

  
459
    u.ull = get_be64(s);
460
    return u.d;
461
}
462

  
463 441
char *get_strz(ByteIOContext *s, char *buf, int maxlen)
464 442
{
465 443
    int i = 0;
libavformat/ffm.c
182 182
            put_be32(pb, codec->rc_max_rate);
183 183
            put_be32(pb, codec->rc_min_rate);
184 184
            put_be32(pb, codec->rc_buffer_size);
185
            put_be64_double(pb, codec->i_quant_factor);
186
            put_be64_double(pb, codec->b_quant_factor);
187
            put_be64_double(pb, codec->i_quant_offset);
188
            put_be64_double(pb, codec->b_quant_offset);
185
            put_be64(pb, av_dbl2int(codec->i_quant_factor));
186
            put_be64(pb, av_dbl2int(codec->b_quant_factor));
187
            put_be64(pb, av_dbl2int(codec->i_quant_offset));
188
            put_be64(pb, av_dbl2int(codec->b_quant_offset));
189 189
            put_be32(pb, codec->dct_algo);
190 190
            put_be32(pb, codec->strict_std_compliance);
191 191
            put_be32(pb, codec->max_b_frames);
......
197 197
            put_be32(pb, codec->mb_decision);
198 198
            put_be32(pb, codec->nsse_weight);
199 199
            put_be32(pb, codec->frame_skip_cmp);
200
            put_be64_double(pb, codec->rc_buffer_aggressivity);
200
            put_be64(pb, av_dbl2int(codec->rc_buffer_aggressivity));
201 201
            break;
202 202
        case CODEC_TYPE_AUDIO:
203 203
            put_be32(pb, codec->sample_rate);
......
513 513
            codec->rc_max_rate = get_be32(pb);
514 514
            codec->rc_min_rate = get_be32(pb);
515 515
            codec->rc_buffer_size = get_be32(pb);
516
            codec->i_quant_factor = get_be64_double(pb);
517
            codec->b_quant_factor = get_be64_double(pb);
518
            codec->i_quant_offset = get_be64_double(pb);
519
            codec->b_quant_offset = get_be64_double(pb);
516
            codec->i_quant_factor = av_int2dbl(get_be64(pb));
517
            codec->b_quant_factor = av_int2dbl(get_be64(pb));
518
            codec->i_quant_offset = av_int2dbl(get_be64(pb));
519
            codec->b_quant_offset = av_int2dbl(get_be64(pb));
520 520
            codec->dct_algo = get_be32(pb);
521 521
            codec->strict_std_compliance = get_be32(pb);
522 522
            codec->max_b_frames = get_be32(pb);
......
528 528
            codec->mb_decision = get_be32(pb);
529 529
            codec->nsse_weight = get_be32(pb);
530 530
            codec->frame_skip_cmp = get_be32(pb);
531
            codec->rc_buffer_aggressivity = get_be64_double(pb);
531
            codec->rc_buffer_aggressivity = av_int2dbl(get_be64(pb));
532 532
            break;
533 533
        case CODEC_TYPE_AUDIO:
534 534
            codec->sample_rate = get_be32(pb);

Also available in: Unified diff