decoder/ffmpeg: add AVFrame wrapper class

This commit is contained in:
Max Kellermann
2019-03-12 23:51:46 +01:00
parent 9acc6617d2
commit 38a0844cdf
2 changed files with 56 additions and 9 deletions

View File

@@ -27,6 +27,7 @@
#include "lib/ffmpeg/LogError.hxx"
#include "lib/ffmpeg/Init.hxx"
#include "lib/ffmpeg/Buffer.hxx"
#include "lib/ffmpeg/Frame.hxx"
#include "../DecoderAPI.hxx"
#include "FfmpegMetaData.hxx"
#include "FfmpegIo.hxx"
@@ -574,15 +575,7 @@ FfmpegDecode(DecoderClient &client, InputStream &input,
FfmpegParseMetaData(client, format_context, audio_stream);
AVFrame *frame = av_frame_alloc();
if (!frame) {
LogError(ffmpeg_domain, "Could not allocate frame");
return;
}
AtScopeExit(&frame) {
av_frame_free(&frame);
};
Ffmpeg::Frame frame;
FfmpegBuffer interleaved_buffer;