Commit bd115a40 authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: use AtScopeExit() to call av_packet_unref()

parent 08272cde
...@@ -627,6 +627,10 @@ FfmpegDecode(DecoderClient &client, InputStream &input, ...@@ -627,6 +627,10 @@ FfmpegDecode(DecoderClient &client, InputStream &input,
/* end of file */ /* end of file */
break; break;
AtScopeExit(&packet) {
av_packet_unref(&packet);
};
FfmpegCheckTag(client, input, format_context, audio_stream); FfmpegCheckTag(client, input, format_context, audio_stream);
if (packet.size > 0 && packet.stream_index == audio_stream) { if (packet.size > 0 && packet.stream_index == audio_stream) {
...@@ -640,8 +644,6 @@ FfmpegDecode(DecoderClient &client, InputStream &input, ...@@ -640,8 +644,6 @@ FfmpegDecode(DecoderClient &client, InputStream &input,
min_frame = 0; min_frame = 0;
} else } else
cmd = client.GetCommand(); cmd = client.GetCommand();
av_packet_unref(&packet);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment