decoder/ffmpeg: ffmpeg_decode() may throw
Don't catch and log exceptions. Let the caller handle the error.
This commit is contained in:
parent
38a0844cdf
commit
bce608cdbc
@ -216,16 +216,8 @@ FfmpegSendFrame(DecoderClient &client, InputStream &is,
|
|||||||
size_t &skip_bytes,
|
size_t &skip_bytes,
|
||||||
FfmpegBuffer &buffer)
|
FfmpegBuffer &buffer)
|
||||||
{
|
{
|
||||||
ConstBuffer<void> output_buffer;
|
ConstBuffer<void> output_buffer =
|
||||||
|
copy_interleave_frame(codec_context, frame, 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (skip_bytes > 0) {
|
if (skip_bytes > 0) {
|
||||||
if (skip_bytes >= output_buffer.size) {
|
if (skip_bytes >= output_buffer.size) {
|
||||||
@ -636,14 +628,8 @@ ffmpeg_decode(DecoderClient &client, InputStream &input)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVFormatContext *format_context;
|
AVFormatContext *format_context =
|
||||||
try {
|
FfmpegOpenInput(stream.io, input.GetURI(), nullptr);
|
||||||
format_context =FfmpegOpenInput(stream.io, input.GetURI(),
|
|
||||||
nullptr);
|
|
||||||
} catch (...) {
|
|
||||||
LogError(std::current_exception());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
AtScopeExit(&format_context) {
|
AtScopeExit(&format_context) {
|
||||||
avformat_close_input(&format_context);
|
avformat_close_input(&format_context);
|
||||||
|
Loading…
Reference in New Issue
Block a user