[FFmpeg-devel] [PATCH 2/3] ffmpeg: warn users about demuxers producing zero sized packets

Marton Balint cus at passwd.hu
Fri Sep 30 12:29:06 EEST 2016


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 ffmpeg.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 9a8e65a..2296df8 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3865,10 +3865,19 @@ static int process_input(int file_index)
     int ret, i, j;
     int64_t duration;
     int64_t pkt_dts;
+    static int warned_zero_sized_packet_bug = 0;
 
     is  = ifile->ctx;
     ret = get_input_packet(ifile, &pkt);
 
+    if (ret >= 0 && pkt.size == 0) {
+        if (!warned_zero_sized_packet_bug) {
+            av_log(is, AV_LOG_ERROR, "Demuxer is generating zero sized packets, report this bug!\n");
+            warned_zero_sized_packet_bug = 1;
+        }
+        ret = AVERROR(EAGAIN);
+    }
+
     if (ret == AVERROR(EAGAIN)) {
         ifile->eagain = 1;
         return ret;
-- 
2.6.6



More information about the ffmpeg-devel mailing list