Revision 43382b5f

View differences:

libavformat/nut.c
79 79
    {""            , 0}
80 80
};
81 81

  
82
const AVMetadataConv ff_nut_metadata_conv[] = {
83
    { "Author",         "artist"      },
84
    { "X-CreationTime", "date"        },
85
    { "CreationTime",   "date"        },
86
    { "SourceFilename", "filename"    },
87
    { "X-Language",     "language"    },
88
    { "X-Disposition",  "disposition" },
89
    { "X-Replaces",     "replaces"    },
90
    { "X-Depends",      "depends"     },
91
    { "X-Uses",         "uses"        },
92
    { "X-UsesFont",     "usesfont"    },
93
    { 0 },
94
};
libavformat/nut.h
27 27
//#include "libavcodec/mpegaudio.h"
28 28
#include "avformat.h"
29 29
#include "riff.h"
30
#include "metadata.h"
30 31

  
31 32
#define      MAIN_STARTCODE (0x7A561F5F04ADULL + (((uint64_t)('N'<<8) + 'M')<<48))
32 33
#define    STREAM_STARTCODE (0x11405BF2F9DBULL + (((uint64_t)('N'<<8) + 'S')<<48))
......
112 113

  
113 114
extern const Dispositions ff_nut_dispositions[];
114 115

  
116
extern const AVMetadataConv ff_nut_metadata_conv[];
117

  
115 118
#endif /* AVFORMAT_NUT_H */
libavformat/nutdec.c
915 915
    nut_read_close,
916 916
    read_seek,
917 917
    .extensions = "nut",
918
    .metadata_conv = ff_nut_metadata_conv,
918 919
};
919 920
#endif
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