From db732e8a3863dcba93aa71cde70c899c9c439bdf Mon Sep 17 00:00:00 2001 From: Johannes Brechtmann Date: Wed, 9 May 2018 16:47:37 +0200 Subject: [PATCH] vba-m: add patch for ffmpeg-4.0.1. --- srcpkgs/vba-m/patches/ffmpeg4.patch | 55 +++++++++++++++++++++++++++++ srcpkgs/vba-m/template | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/vba-m/patches/ffmpeg4.patch diff --git a/srcpkgs/vba-m/patches/ffmpeg4.patch b/srcpkgs/vba-m/patches/ffmpeg4.patch new file mode 100644 index 00000000000..5f5cdc3ee6f --- /dev/null +++ b/srcpkgs/vba-m/patches/ffmpeg4.patch @@ -0,0 +1,55 @@ +source: https://github.com/visualboyadvance-m/visualboyadvance-m/commit/f3f6ee7b1c9f95cc1e8df368652034b9da84c130 + +--- src/common/ffmpeg.cpp.orig 2016-12-14 22:52:45.000000000 +0100 ++++ src/common/ffmpeg.cpp 2018-05-09 16:41:18.048068182 +0200 +@@ -84,11 +84,22 @@ + // I have no idea what size to make these buffers + // I don't see any ffmpeg functions to guess the size, either + +-// use frame size, or FF_MIN_BUFFER_SIZE (that seems to be what it wants) ++#ifdef AV_INPUT_BUFFER_MIN_SIZE ++ ++ // use frame size, or AV_INPUT_BUFFER_MIN_SIZE (that seems to be what it wants) ++#define AUDIO_BUF_LEN (frame_len > AV_INPUT_BUFFER_MIN_SIZE ? frame_len : AV_INPUT_BUFFER_MIN_SIZE) ++ // use maximum frame size * 32 bpp * 2 for good measure ++#define VIDEO_BUF_LEN (AV_INPUT_BUFFER_MIN_SIZE + 256 * 244 * 4 * 2) ++ ++#else ++ ++ // use frame size, or FF_MIN_BUFFER_SIZE (that seems to be what it wants) + #define AUDIO_BUF_LEN (frame_len > FF_MIN_BUFFER_SIZE ? frame_len : FF_MIN_BUFFER_SIZE) +-// use maximum frame size * 32 bpp * 2 for good measure ++ // use maximum frame size * 32 bpp * 2 for good measure + #define VIDEO_BUF_LEN (FF_MIN_BUFFER_SIZE + 256 * 244 * 4 * 2) + ++#endif ++ + bool MediaRecorder::did_init = false; + + MediaRecorder::MediaRecorder() : oc(0), vid_st(0), aud_st(0), video_buf(0), +@@ -435,6 +446,7 @@ + } + av_init_packet(&pkt); + pkt.stream_index = vid_st->index; ++#ifdef AVFMT_RAWPICTURE + if(oc->oformat->flags & AVFMT_RAWPICTURE) { + // this won't work due to border + // not sure what formats set this, anyway +@@ -442,6 +454,7 @@ + pkt.data = f->data[0]; + pkt.size = linesize * ctx->height; + } else { ++#endif + #if LIBAVCODEC_VERSION_MAJOR > 56 + pkt.data = video_buf; + pkt.size = VIDEO_BUF_LEN; +@@ -468,7 +481,9 @@ + if(ctx->coded_frame->key_frame) + pkt.flags |= AV_PKT_FLAG_KEY; + pkt.data = video_buf; ++#ifdef AVFMT_RAWPICTURE + } ++#endif + if(av_interleaved_write_frame(oc, &pkt) < 0) { + avformat_free_context(oc); + oc = NULL; diff --git a/srcpkgs/vba-m/template b/srcpkgs/vba-m/template index 4f843eb0c88..e60e3471de3 100644 --- a/srcpkgs/vba-m/template +++ b/srcpkgs/vba-m/template @@ -2,7 +2,7 @@ pkgname=vba-m reverts=1292_2 version=2.0.2 -revision=2 +revision=3 _subversion=Beta-3 wrksrc="visualboyadvance-m-${_subversion}" build_style=cmake