summaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-11-04 22:01:33 +0100
committerMax Kellermann <max@musicpd.org>2018-11-04 22:01:33 +0100
commitbd115a40081ec6527e1e13231caec23f36768d73 (patch)
treeae5e926a396d4c690b56a68723f823c53513c0fc /src/decoder
parent08272cdee2b886f759ffe632c3310e3ead095b62 (diff)
decoder/ffmpeg: use AtScopeExit() to call av_packet_unref()
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/plugins/FfmpegDecoderPlugin.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 92ab33afa..0abd04841 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -627,6 +627,10 @@ FfmpegDecode(DecoderClient &client, InputStream &input,
/* end of file */
break;
+ AtScopeExit(&packet) {
+ av_packet_unref(&packet);
+ };
+
FfmpegCheckTag(client, input, format_context, audio_stream);
if (packet.size > 0 && packet.stream_index == audio_stream) {
@@ -640,8 +644,6 @@ FfmpegDecode(DecoderClient &client, InputStream &input,
min_frame = 0;
} else
cmd = client.GetCommand();
-
- av_packet_unref(&packet);
}
}