Revision ffdf0d48 libavformat/avienc.c

View differences:

libavformat/avienc.c
114 114
    }
115 115
}
116 116

  
117
static void avi_write_info_tag2(AVFormatContext *s, const char *fourcc, const char *key1, const char *key2)
117
static void avi_write_info_tag2(AVFormatContext *s, AVStream *st, const char *fourcc, const char *key1, const char *key2)
118 118
{
119
    AVMetadataTag *tag= av_metadata_get(s->metadata, key1, NULL, 0);
119
    AVMetadataTag *tag;
120
    if(st){
121
        tag= av_metadata_get(st->metadata, key1, NULL, 0);
122
        if(!tag && key2)
123
            tag= av_metadata_get(st->metadata, key2, NULL, 0);
124
    }else{
125
        tag= av_metadata_get(s->metadata, key1, NULL, 0);
120 126
    if(!tag && key2)
121 127
        tag= av_metadata_get(s->metadata, key2, NULL, 0);
128
    }
122 129
    if(tag)
123 130
        avi_write_info_tag(s->pb, fourcc, tag->value);
124 131
}
......
294 301
            return -1;
295 302
        }
296 303
        ff_end_tag(pb, strf);
304
        avi_write_info_tag2(s, s->streams[i], "strn", "Title", "Description");
297 305
      }
298 306

  
299 307
        if (!url_is_streamed(pb)) {
......
370 378

  
371 379
    list2 = ff_start_tag(pb, "LIST");
372 380
    put_tag(pb, "INFO");
373
    avi_write_info_tag2(s, "INAM", "Title", NULL);
374
    avi_write_info_tag2(s, "IART", "Artist", "Author");
375
    avi_write_info_tag2(s, "ICOP", "Copyright", NULL);
376
    avi_write_info_tag2(s, "ICMT", "Comment", NULL);
377
    avi_write_info_tag2(s, "IPRD", "Album", NULL);
378
    avi_write_info_tag2(s, "IGNR", "Genre", NULL);
379
    avi_write_info_tag2(s, "IPRT", "Track", NULL);
381
    avi_write_info_tag2(s, NULL, "INAM", "Title", NULL);
382
    avi_write_info_tag2(s, NULL, "IART", "Artist", "Author");
383
    avi_write_info_tag2(s, NULL, "ICOP", "Copyright", NULL);
384
    avi_write_info_tag2(s, NULL, "ICMT", "Comment", NULL);
385
    avi_write_info_tag2(s, NULL, "IPRD", "Album", NULL);
386
    avi_write_info_tag2(s, NULL, "IGNR", "Genre", NULL);
387
    avi_write_info_tag2(s, NULL, "IPRT", "Track", NULL);
380 388
    if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
381 389
        avi_write_info_tag(pb, "ISFT", LIBAVFORMAT_IDENT);
382 390
    ff_end_tag(pb, list2);

Also available in: Unified diff