Revision 46911c7a

View differences:

libavformat/mpegtsenc.c
672 672
    MpegTSWriteStream *ts_st = st->priv_data;
673 673
    int len, max_payload_size;
674 674
    const uint8_t *access_unit_index = NULL;
675
    const uint64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE);
675 676

  
676 677
    if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) {
677 678
        /* for subtitle, a single PES packet must be generated */
......
717 718
        if (access_unit_index && access_unit_index < buf &&
718 719
            ts_st->payload_pts == AV_NOPTS_VALUE &&
719 720
            ts_st->payload_dts == AV_NOPTS_VALUE) {
720
            ts_st->payload_dts = pkt->dts;
721
            ts_st->payload_pts = pkt->pts;
721
            ts_st->payload_dts = pkt->dts + delay;
722
            ts_st->payload_pts = pkt->pts + delay;
722 723
        }
723 724
        if (ts_st->payload_index >= max_payload_size) {
724 725
            mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_index,
tests/libav.regression.ref
9 9
bdb7484c68db722f66ba1630cf79844c *./tests/data/b-libav.mpg
10 10
378880 ./tests/data/b-libav.mpg
11 11
./tests/data/b-libav.mpg CRC=0x2b71a386
12
d1ab4041e32fb802bb164844d91cc5fe *./tests/data/b-libav.ts
12
9fd96456cbf2a550da816e563316d92f *./tests/data/b-libav.ts
13 13
471692 ./tests/data/b-libav.ts
14 14
./tests/data/b-libav.ts CRC=0xcc4948e1
15 15
1b28a16652bb8ac528b33f7478ca18b6 *./tests/data/b-libav.swf

Also available in: Unified diff