diff mbox

[FFmpeg-devel] avformat/utils: Simplify condition in av_read_frame()

Message ID 20191127142455.15369-1-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer Nov. 27, 2019, 2:24 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8196442dd1..dc79987ec1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1830,8 +1830,8 @@  int av_read_frame(AVFormatContext *s, AVPacket *pkt)
 
             /* read packet from packet buffer, if there is data */
             st = s->streams[next_pkt->stream_index];
-            if (!(next_pkt->pts == AV_NOPTS_VALUE && st->discard < AVDISCARD_ALL &&
-                  next_pkt->dts != AV_NOPTS_VALUE && !eof)) {
+            if (next_pkt->pts != AV_NOPTS_VALUE || st->discard >= AVDISCARD_ALL ||
+                next_pkt->dts == AV_NOPTS_VALUE || eof) {
                 ret = ff_packet_list_get(&s->internal->packet_buffer,
                                                &s->internal->packet_buffer_end, pkt);
                 goto return_packet;