From 0a8bfe89bda425d5e596b5dbc8b64cdfc1bcb5d0 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Thu, 5 Jan 2017 14:53:45 +0100 Subject: [PATCH] In push_packet functions, the return code of av_interleaved_write_frame is ignored. We don't know if the outfile is in a disk error, disk full, or pipe issue state. it seems you planned to do that by defining "ret" as an integer ;) This patch handle this case. --- bmdcapture.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bmdcapture.cpp b/bmdcapture.cpp index 902cd7d..4b7af5c 100644 --- a/bmdcapture.cpp +++ b/bmdcapture.cpp @@ -629,8 +629,9 @@ static void *push_packet(void *ctx) int ret; while (avpacket_queue_get(&queue, &pkt, 1)) { - av_interleaved_write_frame(s, &pkt); - if ((g_maxFrames > 0 && frameCount >= g_maxFrames) || + ret = av_interleaved_write_frame(s, &pkt); + if (ret || + (g_maxFrames > 0 && frameCount >= g_maxFrames) || avpacket_queue_size(&queue) > g_memoryLimit) { pthread_cond_signal(&sleepCond); }