Revision 47146dfb libavformat/avienc.c

View differences:

libavformat/avienc.c
103 103
    }
104 104
}
105 105

  
106
static void avi_write_info_tag2(AVFormatContext *s, const char *fourcc, const char *key1, const char *key2)
107
{
108
    AVMetaDataTag *tag= av_metadata_get(s->meta_data, key1, NULL, AV_METADATA_IGNORE_CASE);
109
    if(!tag && key2)
110
        tag= av_metadata_get(s->meta_data, key2, NULL, AV_METADATA_IGNORE_CASE);
111
    if(tag)
112
        avi_write_info_tag(s->pb, fourcc, tag->value);
113
}
114

  
106 115
static int avi_write_counters(AVFormatContext* s, int riff_id)
107 116
{
108 117
    ByteIOContext *pb = s->pb;
......
332 341

  
333 342
    list2 = start_tag(pb, "LIST");
334 343
    put_tag(pb, "INFO");
335
    avi_write_info_tag(pb, "INAM", s->title);
336
    avi_write_info_tag(pb, "IART", s->author);
337
    avi_write_info_tag(pb, "ICOP", s->copyright);
338
    avi_write_info_tag(pb, "ICMT", s->comment);
339
    avi_write_info_tag(pb, "IPRD", s->album);
340
    avi_write_info_tag(pb, "IGNR", s->genre);
341
    if (s->track) {
342
        char str_track[4];
343
        snprintf(str_track, 4, "%d", s->track);
344
        avi_write_info_tag(pb, "IPRT", str_track);
345
    }
344
    avi_write_info_tag2(s, "INAM", "Title", NULL);
345
    avi_write_info_tag2(s, "IART", "Artist", "Author");
346
    avi_write_info_tag2(s, "ICOP", "Copyright", NULL);
347
    avi_write_info_tag2(s, "ICMT", "Comment", NULL);
348
    avi_write_info_tag2(s, "IPRD", "Album", NULL);
349
    avi_write_info_tag2(s, "IGNR", "Genre", NULL);
350
    avi_write_info_tag2(s, "IPRT", "Track", NULL);
346 351
    if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
347 352
        avi_write_info_tag(pb, "ISFT", LIBAVFORMAT_IDENT);
348 353
    end_tag(pb, list2);

Also available in: Unified diff