Revision e1e8a8de libavformat/mp3enc.c

View differences:

libavformat/mp3enc.c
163 163
typedef struct MP3Context {
164 164
    const AVClass *class;
165 165
    int id3v2_version;
166
    int64_t offset;
166
    int64_t frames_offset;
167 167
    int32_t frames;
168 168
    int32_t size;
169 169
    uint32_t want;
......
266 266
    avio_wb32(s->pb, MKBETAG('X', 'i', 'n', 'g'));
267 267
    avio_wb32(s->pb, 0x01 | 0x02 | 0x04);  // frames/size/toc
268 268

  
269
    mp3->offset = avio_tell(s->pb);
269
    mp3->frames_offset = avio_tell(s->pb);
270 270
    mp3->size = c.frame_size;
271 271
    mp3->want=1;
272 272
    mp3->seen=0;
......
321 321
    int i;
322 322

  
323 323
    avio_flush(s->pb);
324
    avio_seek(s->pb, mp3->offset, SEEK_SET);
324
    avio_seek(s->pb, mp3->frames_offset, SEEK_SET);
325 325
    avio_wb32(s->pb, mp3->frames);
326 326
    avio_wb32(s->pb, mp3->size);
327 327

  
......
420 420
            return 0;
421 421
#endif
422 422

  
423
        if (0 < mp3->offset)
423
        if (0 < mp3->frames_offset)
424 424
            mp3_xing_add_frame(s, pkt);
425 425

  
426 426
        return ff_raw_write_packet(s, pkt);
......
435 435
    if (ret < 0)
436 436
        return ret;
437 437

  
438
    if (0 < mp3->offset)
438
    if (0 < mp3->frames_offset)
439 439
        mp3_fix_xing(s);
440 440

  
441 441
    return 0;

Also available in: Unified diff