avformat/utils: fix mixed declarations and code
authorJames Almer <jamrial@gmail.com>
Fri, 24 Nov 2017 20:46:16 +0000 (17:46 -0300)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 12 Apr 2018 23:20:14 +0000 (01:20 +0200)
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 31de45d20b1ff90d4baf7c5a65e88f582efdb2a6)

libavformat/utils.c

index 2053c3f..0749151 100644 (file)
@@ -1732,10 +1732,10 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
 
             if (next_pkt->dts != AV_NOPTS_VALUE) {
                 int wrap_bits = s->streams[next_pkt->stream_index]->pts_wrap_bits;
-                av_assert2(wrap_bits <= 64);
                 // last dts seen for this stream. if any of packets following
                 // current one had no dts, we will set this to AV_NOPTS_VALUE.
                 int64_t last_dts = next_pkt->dts;
+                av_assert2(wrap_bits <= 64);
                 while (pktl && next_pkt->pts == AV_NOPTS_VALUE) {
                     if (pktl->pkt.stream_index == next_pkt->stream_index &&
                         av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2ULL << (wrap_bits - 1)) < 0) {