diff mbox

[FFmpeg-devel,2/2] avformat/nutdec: skip EOR packets if they are subtitles

Message ID 20181218135655.4152-2-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol Dec. 18, 2018, 1:56 p.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavformat/nutdec.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 056ef59d00..1d1c449bbd 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -1080,6 +1080,10 @@  static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
 
     stc = &nut->stream[stream_id];
 
+    if (stc->last_flags & FLAG_EOR &&
+        s->streams[stream_id]->codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE)
+        return 1;
+
     if (stc->last_flags & FLAG_KEY)
         stc->skip_until_key_frame = 0;