From: Steinar H. Gunderson Date: Sat, 9 Mar 2019 21:00:40 +0000 (+0100) Subject: Add a failsafe for interrupted FFmpeg streams. X-Git-Tag: 1.8.3~5 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=12a49f3988eae5868d89b79b7ad2da0c90c29d1d Add a failsafe for interrupted FFmpeg streams. --- diff --git a/nageru/ffmpeg_capture.cpp b/nageru/ffmpeg_capture.cpp index 1c7a30f..722d313 100644 --- a/nageru/ffmpeg_capture.cpp +++ b/nageru/ffmpeg_capture.cpp @@ -451,6 +451,10 @@ bool FFmpegCapture::play_video(const string &pathname) if (process_queued_commands(format_ctx.get(), pathname, last_modified, /*rewound=*/nullptr)) { return true; } + if (should_interrupt.load()) { + // Check as a failsafe, so that we don't need to rely on avio if we don't have to. + return false; + } UniqueFrame audio_frame = audio_frame_allocator->alloc_frame(); AudioFormat audio_format;