Revision 6cb6e159 libavformat/matroskadec.c

View differences:

libavformat/matroskadec.c
154 154
    uint64_t end;
155 155
    uint64_t uid;
156 156
    char    *title;
157

  
158
    AVChapter *chapter;
157 159
} MatroskaChapter;
158 160

  
159 161
typedef struct {
......
1103 1105
    if (matroska->duration)
1104 1106
        matroska->ctx->duration = matroska->duration * matroska->time_scale
1105 1107
                                  * 1000 / AV_TIME_BASE;
1106
    if (matroska->title)
1107
        strncpy(matroska->ctx->title, matroska->title,
1108
                sizeof(matroska->ctx->title)-1);
1108
    av_metadata_set(&s->metadata, "title", matroska->title);
1109 1109
    matroska_convert_tags(s, &matroska->tags);
1110 1110

  
1111 1111
    tracks = matroska->tracks.elem;
......
1294 1294
        st->codec->codec_id = codec_id;
1295 1295
        st->start_time = 0;
1296 1296
        if (strcmp(track->language, "und"))
1297
            av_strlcpy(st->language, track->language, 4);
1297
            av_metadata_set(&st->metadata, "language", track->language);
1298 1298

  
1299 1299
        if (track->flag_default)
1300 1300
            st->disposition |= AV_DISPOSITION_DEFAULT;
......
1346 1346
            AVStream *st = av_new_stream(s, 0);
1347 1347
            if (st == NULL)
1348 1348
                break;
1349
            st->filename          = av_strdup(attachements[j].filename);
1349
            av_metadata_set(&st->metadata, "filename",attachements[j].filename);
1350 1350
            st->codec->codec_id = CODEC_ID_NONE;
1351 1351
            st->codec->codec_type = CODEC_TYPE_ATTACHMENT;
1352 1352
            st->codec->extradata  = av_malloc(attachements[j].bin.size);
......
1369 1369
    for (i=0; i<chapters_list->nb_elem; i++)
1370 1370
        if (chapters[i].start != AV_NOPTS_VALUE && chapters[i].uid
1371 1371
            && (max_start==0 || chapters[i].start > max_start)) {
1372
            chapters[i].chapter =
1372 1373
            ff_new_chapter(s, chapters[i].uid, (AVRational){1, 1000000000},
1373 1374
                           chapters[i].start, chapters[i].end,
1374 1375
                           chapters[i].title);
1376
            av_metadata_set(&chapters[i].chapter->metadata,
1377
                            "title", chapters[i].title);
1375 1378
            max_start = chapters[i].start;
1376 1379
        }
1377 1380

  

Also available in: Unified diff