Revision 43382b5f libavformat/nutenc.c

View differences:

libavformat/nutenc.c
448 448

  
449 449
static int write_globalinfo(NUTContext *nut, ByteIOContext *bc){
450 450
    AVFormatContext *s= nut->avf;
451
    AVMetadataTag *title, *author, *copyright;
451
    AVMetadataTag *t = NULL;
452 452
    ByteIOContext *dyn_bc;
453 453
    uint8_t *dyn_buf=NULL;
454 454
    int count=0, dyn_size;
......
456 456
    if(ret < 0)
457 457
        return ret;
458 458

  
459
    title     = av_metadata_get(s->metadata, "Title"    , NULL, 0);
460
    author    = av_metadata_get(s->metadata, "Author"   , NULL, 0);
461
    copyright = av_metadata_get(s->metadata, "Copyright", NULL, 0);
462

  
463
    if(title    ) count+= add_info(dyn_bc, "Title"    , title->value);
464
    if(author   ) count+= add_info(dyn_bc, "Author"   , author->value);
465
    if(copyright) count+= add_info(dyn_bc, "Copyright", copyright->value);
466
    if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
467
                        count+= add_info(dyn_bc, "Encoder"  , LIBAVFORMAT_IDENT);
459
    while ((t = av_metadata_get(s->metadata, "", t, AV_METADATA_IGNORE_SUFFIX)))
460
        count += add_info(dyn_bc, t->key, t->value);
468 461

  
469 462
    put_v(bc, 0); //stream_if_plus1
470 463
    put_v(bc, 0); //chapter_id
......
827 820
    write_trailer,
828 821
    .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
829 822
    .codec_tag= (const AVCodecTag* const []){ff_codec_bmp_tags, ff_codec_wav_tags, ff_nut_subtitle_tags, 0},
823
    .metadata_conv = ff_nut_metadata_conv,
830 824
};

Also available in: Unified diff