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) |
| 1937 | 1937 | if (sc->empty_duration) |
| 1938 | 1938 | sc->empty_duration = av_rescale(sc->empty_duration, sc->time_scale, mov->time_scale); |
| 1939 | 1939 | sc->time_offset = sc->start_time - sc->empty_duration; |
| 1940 | | current_dts = -sc->time_offset; |
| 1941 | 1940 | if (sc->ctts_count>0 && sc->stts_count>0 && |
| 1942 | 1941 | sc->ctts_data[0].duration / FFMAX(sc->stts_data[0].duration, 1) > 16) { |
| 1943 | 1942 | /* more than 16 frames delay, dts are likely wrong |
| … |
… |
static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 3240 | 3239 | pkt->stream_index = sc->ffindex; |
| 3241 | 3240 | pkt->dts = sample->timestamp; |
| 3242 | 3241 | 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; |
| 3244 | 3243 | /* update ctts context */ |
| 3245 | 3244 | sc->ctts_sample++; |
| 3246 | 3245 | if (sc->ctts_index < sc->ctts_count && |