Ticket #1759: patch.diff

File patch.diff, 1.1 KB (added by nikola.vranic, 4 years ago)
  • libavformat/mov.c

    diff --git a/libavformat/mov.c b/libavformat/mov.c
    index 84565c8..c34d097 100644
    a b static void mov_build_index(MOVContext *mov, AVStream *st) 
    19371937        if (sc->empty_duration) 
    19381938            sc->empty_duration = av_rescale(sc->empty_duration, sc->time_scale, mov->time_scale); 
    19391939        sc->time_offset = sc->start_time - sc->empty_duration; 
    1940         current_dts = -sc->time_offset; 
    19411940        if (sc->ctts_count>0 && sc->stts_count>0 && 
    19421941            sc->ctts_data[0].duration / FFMAX(sc->stts_data[0].duration, 1) > 16) { 
    19431942            /* more than 16 frames delay, dts are likely wrong 
    static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) 
    32403239    pkt->stream_index = sc->ffindex; 
    32413240    pkt->dts = sample->timestamp; 
    32423241    if (sc->ctts_data && sc->ctts_index < sc->ctts_count) { 
    3243         pkt->pts = pkt->dts + sc->dts_shift + sc->ctts_data[sc->ctts_index].duration; 
     3242        pkt->pts = pkt->dts + sc->dts_shift + sc->ctts_data[sc->ctts_index].duration - sc->time_offset; 
    32443243        /* update ctts context */ 
    32453244        sc->ctts_sample++; 
    32463245        if (sc->ctts_index < sc->ctts_count &&