---
 src/decoder/plugins/FfmpegDecoderPlugin.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 66b3ec0..f2ad714 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -424,8 +424,11 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
        const SampleFormat sample_format =
                ffmpeg_sample_format(codec_context->sample_fmt);
-       if (sample_format == SampleFormat::UNDEFINED)
+       if (sample_format == SampleFormat::UNDEFINED) {
+               // (error message already done by ffmpeg_sample_format())
+               avformat_close_input(&format_context);
                return;
+       }
        Error error;
        AudioFormat audio_format;

_______________________________________________
mpd-devel mailing list
[email protected]
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to