Revision 032d8aec libavformat/gxfenc.c

View differences:

libavformat/gxfenc.c
50 50
} GXFStreamContext;
51 51

  
52 52
typedef struct GXFContext {
53
    uint32_t nb_frames;
53
    uint32_t nb_fields;
54 54
    uint32_t material_flags;
55 55
    uint16_t audio_tracks;
56 56
    uint16_t mpeg_tracks;
......
296 296
    /* last field */
297 297
    put_byte(pb, MAT_LAST_FIELD);
298 298
    put_byte(pb, 4);
299
    put_be32(pb, ctx->nb_frames);
299
    put_be32(pb, ctx->nb_fields);
300 300

  
301 301
    /* reserved */
302 302
    put_byte(pb, MAT_MARK_IN);
......
305 305

  
306 306
    put_byte(pb, MAT_MARK_OUT);
307 307
    put_byte(pb, 4);
308
    put_be32(pb, ctx->nb_frames);
308
    put_be32(pb, ctx->nb_fields);
309 309

  
310 310
    /* estimated size */
311 311
    put_byte(pb, MAT_SIZE);
......
365 365
{
366 366
    // XXX drop frame
367 367
    uint32_t timecode =
368
        ctx->nb_frames / (ctx->sample_rate * 3600) % 24 << 24 | // hours
369
        ctx->nb_frames / (ctx->sample_rate * 60) % 60   << 16 | // minutes
370
        ctx->nb_frames / ctx->sample_rate % 60          <<  8 | // seconds
371
        ctx->nb_frames % ctx->sample_rate;                    // fields
368
        ctx->nb_fields / (ctx->sample_rate * 3600) % 24 << 24 | // hours
369
        ctx->nb_fields / (ctx->sample_rate * 60) % 60   << 16 | // minutes
370
        ctx->nb_fields / ctx->sample_rate % 60          <<  8 | // seconds
371
        ctx->nb_fields % ctx->sample_rate;                    // fields
372 372

  
373 373
    put_le32(pb, ctx->flags);
374
    put_le32(pb, ctx->nb_frames); /* length of the longest track */
375
    put_le32(pb, ctx->nb_frames); /* length of the shortest track */
374
    put_le32(pb, ctx->nb_fields); /* length of the longest track */
375
    put_le32(pb, ctx->nb_fields); /* length of the shortest track */
376 376
    put_le32(pb, 0); /* mark in */
377
    put_le32(pb, ctx->nb_frames); /* mark out */
377
    put_le32(pb, ctx->nb_fields); /* mark out */
378 378
    put_le32(pb, 0); /* timecode mark in */
379 379
    put_le32(pb, timecode); /* timecode mark out */
380 380
    put_le64(pb, ctx->fc->timestamp); /* modification time */
......
520 520
        put_le16(pb, sc->media_info);
521 521
        put_le16(pb, 0); /* reserved */
522 522
        put_le16(pb, 0); /* reserved */
523
        put_le32(pb, ctx->nb_frames);
523
        put_le32(pb, ctx->nb_fields);
524 524
        put_le32(pb, 0); /* attributes rw, ro */
525 525
        put_le32(pb, 0); /* mark in */
526
        put_le32(pb, ctx->nb_frames); /* mark out */
526
        put_le32(pb, ctx->nb_fields); /* mark out */
527 527
        strncpy(buffer, ES_NAME_PATTERN, path_size);
528 528
        put_buffer(pb, (uint8_t *)buffer, path_size);
529 529
        put_be16(pb, sc->media_info);
......
776 776
    gxf_write_padding(pb, padding);
777 777

  
778 778
    if (sc->codec->codec_type == CODEC_TYPE_VIDEO)
779
        ctx->nb_frames += 2; // count fields
779
        ctx->nb_fields += 2; // count fields
780 780

  
781 781
    return updatePacketSize(pb, pos);
782 782
}

Also available in: Unified diff