~ubuntu-branches/ubuntu/utopic/ffmpeg-debian/utopic

« back to all changes in this revision

Viewing changes to libavformat/avienc.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-01-20 09:20:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120092053-izz63p40hc98qfgp
Tags: 3:0.svn20090119-1ubuntu1
* merge from debian. LP: #318501
* new version fixes CVE-2008-3230, LP: #253767

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 *  - fill all fields if non streamed (nb_frames for example)
28
28
 */
29
29
 
30
 
#ifdef CONFIG_AVI_MUXER
 
30
#if CONFIG_AVI_MUXER
31
31
typedef struct AVIIentry {
32
32
    unsigned int flags, pos, len;
33
33
} AVIIentry;
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->metadata, key1, NULL, 0);
 
109
    if(!tag && key2)
 
110
        tag= av_metadata_get(s->metadata, key2, NULL, 0);
 
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);