Browse Source

avformat/mov: Only set pkt->duration to non negative values

Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8176799f31)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.8
Michael Niedermayer 7 years ago
parent
commit
98f10ca12c
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/mov.c

+ 3
- 1
libavformat/mov.c View File

@@ -6384,7 +6384,9 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
} else {
int64_t next_dts = (sc->current_sample < st->nb_index_entries) ?
st->index_entries[sc->current_sample].timestamp : st->duration;
pkt->duration = next_dts - pkt->dts;

if (next_dts >= pkt->dts)
pkt->duration = next_dts - pkt->dts;
pkt->pts = pkt->dts;
}
if (st->discard == AVDISCARD_ALL)


Loading…
Cancel
Save