Revision e7d4b743

View differences:

libavformat/matroskadec.c
934 934
}
935 935

  
936 936
static void matroska_fix_ass_packet(MatroskaDemuxContext *matroska,
937
                                    AVPacket *pkt)
937
                                    AVPacket *pkt, uint64_t display_duration)
938 938
{
939 939
    char *line, *layer, *ptr = pkt->data, *end = ptr+pkt->size;
940 940
    for (; *ptr!=',' && ptr<end-1; ptr++);
......
942 942
        layer = ++ptr;
943 943
    for (; *ptr!=',' && ptr<end-1; ptr++);
944 944
    if (*ptr == ',') {
945
        int64_t end_pts = pkt->pts + pkt->convergence_duration;
945
        int64_t end_pts = pkt->pts + display_duration;
946 946
        int sc = matroska->time_scale * pkt->pts / 10000000;
947 947
        int ec = matroska->time_scale * end_pts  / 10000000;
948 948
        int sh, sm, ss, eh, em, es, len;
......
1627 1627
                    pkt->duration = duration;
1628 1628

  
1629 1629
                if (st->codec->codec_id == CODEC_ID_SSA)
1630
                    matroska_fix_ass_packet(matroska, pkt);
1630
                    matroska_fix_ass_packet(matroska, pkt, duration);
1631 1631

  
1632 1632
                dynarray_add(&matroska->packets, &matroska->num_packets, pkt);
1633 1633
            }

Also available in: Unified diff