Build with newer FFmpeg

Index: Core/HW/SimpleAudioDec.cpp
--- Core/HW/SimpleAudioDec.cpp.orig
+++ Core/HW/SimpleAudioDec.cpp
@@ -133,7 +133,7 @@ class FFmpegAudioDecoder : public AudioDecoder { (priv
 	int channels_;
 
 	AVFrame *frame_ = nullptr;
-	AVCodec *codec_ = nullptr;
+	const AVCodec *codec_ = nullptr;
 	AVCodecContext  *codecCtx_ = nullptr;
 	SwrContext      *swrCtx_ = nullptr;
 
@@ -286,7 +286,7 @@ FFmpegAudioDecoder::~FFmpegAudioDecoder() {
 	avcodec_free_context(&codecCtx_);
 #else
 	// Future versions may add other things to free, but avcodec_free_context didn't exist yet here.
-	avcodec_close(codecCtx_);
+	avcodec_free_context(&codecCtx_);
 	av_freep(&codecCtx_->extradata);
 	av_freep(&codecCtx_->subtitle_header);
 	av_freep(&codecCtx_);
@@ -327,7 +327,7 @@ bool FFmpegAudioDecoder::Decode(const uint8_t *inbuf, 
 	int err = avcodec_receive_frame(codecCtx_, frame_);
 	int len = 0;
 	if (err >= 0) {
-		len = frame_->pkt_size;
+		len = packet.size;
 		got_frame = 1;
 	} else if (err != AVERROR(EAGAIN)) {
 		len = err;
@@ -392,7 +392,7 @@ bool FFmpegAudioDecoder::Decode(const uint8_t *inbuf, 
 
 			if (!swrCtx_ || swr_init(swrCtx_) < 0) {
 				ERROR_LOG(Log::ME, "swr_init: Failed to initialize the resampling context");
-				avcodec_close(codecCtx_);
+				avcodec_free_context(&codecCtx_);
 				codec_ = 0;
 				return false;
 			}
