From bce608cdbc63299481ece774f605d767c6263368 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Mar 2019 00:20:13 +0100 Subject: [PATCH] decoder/ffmpeg: ffmpeg_decode() may throw Don't catch and log exceptions. Let the caller handle the error. --- src/decoder/plugins/FfmpegDecoderPlugin.cxx | 22 ++++----------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 0d96e119d..967ae605e 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -216,16 +216,8 @@ FfmpegSendFrame(DecoderClient &client, InputStream &is, size_t &skip_bytes, FfmpegBuffer &buffer) { - ConstBuffer output_buffer; - - try { - output_buffer = copy_interleave_frame(codec_context, frame, - buffer); - } catch (...) { - /* this must be a serious error, e.g. OOM */ - LogError(std::current_exception()); - return DecoderCommand::STOP; - } + ConstBuffer output_buffer = + copy_interleave_frame(codec_context, frame, buffer); if (skip_bytes > 0) { if (skip_bytes >= output_buffer.size) { @@ -636,14 +628,8 @@ ffmpeg_decode(DecoderClient &client, InputStream &input) return; } - AVFormatContext *format_context; - try { - format_context =FfmpegOpenInput(stream.io, input.GetURI(), - nullptr); - } catch (...) { - LogError(std::current_exception()); - return; - } + AVFormatContext *format_context = + FfmpegOpenInput(stream.io, input.GetURI(), nullptr); AtScopeExit(&format_context) { avformat_close_input(&format_context);