From 241fe30d4a57559313fc17d6c6a1486ddd4545c1 Mon Sep 17 00:00:00 2001 From: Felix Palmen Date: Tue, 27 Jun 2023 19:30:07 +0200 Subject: emulators/emu64: Update to 5.1.0 Changes: https://github.com/ThKattanek/emu64/releases/tag/5.1.0 Approved by: tcberner (mentor, implicit) --- emulators/emu64/Makefile | 3 +- emulators/emu64/distinfo | 6 +- emulators/emu64/files/patch-ffmpeg6 | 120 ------------------------------ emulators/emu64/files/patch-src_savepng.c | 11 +++ emulators/emu64/files/patch-src_src.pro | 4 +- 5 files changed, 17 insertions(+), 127 deletions(-) delete mode 100644 emulators/emu64/files/patch-ffmpeg6 create mode 100644 emulators/emu64/files/patch-src_savepng.c diff --git a/emulators/emu64/Makefile b/emulators/emu64/Makefile index e22360e5b732..251f3f6b1b89 100644 --- a/emulators/emu64/Makefile +++ b/emulators/emu64/Makefile @@ -1,6 +1,5 @@ PORTNAME= emu64 -DISTVERSION= 5.0.19 -PORTREVISION= 5 +DISTVERSION= 5.1.0 CATEGORIES= emulators MAINTAINER= zirias@FreeBSD.org diff --git a/emulators/emu64/distinfo b/emulators/emu64/distinfo index a81c699f485f..45fc362c462e 100644 --- a/emulators/emu64/distinfo +++ b/emulators/emu64/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1625814662 -SHA256 (ThKattanek-emu64-5.0.19_GH0.tar.gz) = 225d66d17f5e803137b373df3905063abcf7f77a5c914f7307913b18f6d51315 -SIZE (ThKattanek-emu64-5.0.19_GH0.tar.gz) = 1641017 +TIMESTAMP = 1687885979 +SHA256 (ThKattanek-emu64-5.1.0_GH0.tar.gz) = 492b5b395b4493440fc59915a4c6cd94f42d21b8fdf58edf9160832c3f22c796 +SIZE (ThKattanek-emu64-5.1.0_GH0.tar.gz) = 2760960 diff --git a/emulators/emu64/files/patch-ffmpeg6 b/emulators/emu64/files/patch-ffmpeg6 deleted file mode 100644 index 80f143f39389..000000000000 --- a/emulators/emu64/files/patch-ffmpeg6 +++ /dev/null @@ -1,120 +0,0 @@ -From e09e645a88f37fa2a81d754cb9c86c4a584941a1 Mon Sep 17 00:00:00 2001 -From: Felix Palmen -Date: Mon, 20 Mar 2023 09:42:43 +0100 -Subject: [PATCH] Fix build with ffmpeg 6 - -This doesn't attempt to replace deprecated functions, it only replaces -functions that are gone (avcodec_encode_[audio|video]2) with -straight-forward replacement code. - -It fixes the build with the latest 6.0 release and still builds fine -with ffmpeg 4.4 ---- src/video_capture_class.cpp.orig 2021-07-08 16:55:15 UTC -+++ src/video_capture_class.cpp -@@ -87,7 +87,9 @@ bool VideoCaptureClass::StartCapture(const char *filen - - int ret; - -+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100) - av_register_all(); -+#endif - - // - avformat_alloc_output_context2(&format_ctx, nullptr, nullptr, filename); -@@ -267,7 +269,7 @@ int VideoCaptureClass::GetRecordedFrameCount() - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - --void VideoCaptureClass::AddStream(OutputStream *ost, AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id) -+void VideoCaptureClass::AddStream(OutputStream *ost, AVFormatContext *oc, const AVCodec **codec, enum AVCodecID codec_id) - { - AVCodecContext *c; - int i; -@@ -363,7 +365,7 @@ void VideoCaptureClass::CloseStream(OutputStream *ost) - swr_free(&ost->swr_ctx); - } - --bool VideoCaptureClass::OpenVideo(AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg) -+bool VideoCaptureClass::OpenVideo(const AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg) - { - int ret; - AVCodecContext *c = ost->enc; -@@ -431,7 +433,7 @@ AVFrame* VideoCaptureClass::AllocPicture(enum AVPixelF - return picture; - } - --bool VideoCaptureClass::OpenAudio(AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg) -+bool VideoCaptureClass::OpenAudio(const AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg) - { - AVCodecContext *c; - int nb_samples; -@@ -532,7 +534,10 @@ int VideoCaptureClass::WriteVideoFrame(AVFormatContext - av_init_packet(&pkt); - - /* encode the image */ -- ret = avcodec_encode_video2(c, &pkt, frame, &got_packet); -+ ret = avcodec_receive_packet(c, &pkt); -+ if (ret == 0) got_packet = 1; -+ if (ret == AVERROR(EAGAIN)) ret = 0; -+ if (ret == 0) ret = avcodec_send_frame(c, frame); - if (ret < 0) - { - char err_msg[AV_ERROR_MAX_STRING_SIZE]; -@@ -562,7 +567,7 @@ int VideoCaptureClass::WriteAudioFrame(AVFormatContext - AVPacket pkt = {}; // data and size must be 0; - AVFrame *frame; - int64_t ret; -- int got_packet; -+ int got_packet = 0; - int64_t dst_nb_samples; - av_init_packet(&pkt); - c = ost->enc; -@@ -595,7 +600,10 @@ int VideoCaptureClass::WriteAudioFrame(AVFormatContext - frame->pts = av_rescale_q(ost->samples_count, AVRational{1, c->sample_rate}, c->time_base); - ost->samples_count += dst_nb_samples; - } -- ret = avcodec_encode_audio2(c, &pkt, frame, &got_packet); -+ ret = avcodec_receive_packet(c, &pkt); -+ if (ret == 0) got_packet = 1; -+ if (ret == AVERROR(EAGAIN)) ret = 0; -+ if (ret == 0) ret = avcodec_send_frame(c, frame); - - if (ret < 0) - { ---- src/video_capture_class.h.orig 2021-07-08 16:55:15 UTC -+++ src/video_capture_class.h -@@ -31,6 +31,7 @@ using namespace std; - - extern "C" - { -+ #include - #include - #include - #include -@@ -84,11 +85,11 @@ class VideoCaptureClass (public) - bool mutex_01; - - private: -- void AddStream(OutputStream *ost, AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id); -+ void AddStream(OutputStream *ost, AVFormatContext *oc, const AVCodec **codec, enum AVCodecID codec_id); - void CloseStream(OutputStream *ost); -- bool OpenVideo(AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg); -+ bool OpenVideo(const AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg); - AVFrame* AllocPicture(enum AVPixelFormat pix_fmt, int width, int height); -- bool OpenAudio(AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg); -+ bool OpenAudio(const AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg); - AVFrame* AllocAudioFrame(enum AVSampleFormat sample_fmt, uint64_t channel_layout, int sample_rate, int nb_samples); - int WriteFrame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt); - -@@ -110,9 +111,9 @@ class VideoCaptureClass (public) - int video_bitrate, audio_bitrate; - - -- AVOutputFormat *output_format; -+ const AVOutputFormat *output_format; - OutputStream audio_stream; -- AVCodec *video_codec, *audio_codec; -+ const AVCodec *video_codec, *audio_codec; - AVDictionary *options; - - uint8_t* source_video_data; diff --git a/emulators/emu64/files/patch-src_savepng.c b/emulators/emu64/files/patch-src_savepng.c new file mode 100644 index 000000000000..fb322a9395fc --- /dev/null +++ b/emulators/emu64/files/patch-src_savepng.c @@ -0,0 +1,11 @@ +--- src/savepng.c.orig 2023-06-27 17:17:48 UTC ++++ src/savepng.c +@@ -25,7 +25,7 @@ + #endif + + /* libpng callbacks */ +-static void png_error_SDL(png_structp *png_ptr, png_const_charp str) ++static void png_error_SDL(png_structp png_ptr, png_const_charp str) + { + SDL_SetError("libpng: %s\n", str); + } diff --git a/emulators/emu64/files/patch-src_src.pro b/emulators/emu64/files/patch-src_src.pro index f5fe38f8ff5b..3296417a4ccb 100644 --- a/emulators/emu64/files/patch-src_src.pro +++ b/emulators/emu64/files/patch-src_src.pro @@ -1,6 +1,6 @@ ---- src/src.pro.orig 2021-07-08 16:55:15 UTC +--- src/src.pro.orig 2023-06-23 23:22:04 UTC +++ src/src.pro -@@ -84,7 +84,7 @@ equals(QT_MAJOR_VERSION, 5) { +@@ -91,7 +91,7 @@ equals(QT_MAJOR_VERSION, 5) { win32 { PKGCONFIG += quazip } else { -- cgit v1.2.3