On Thu, May 11, 2023 at 12:29:38AM -0400, Brad Smith wrote: > Here is an update to corsixth 0.66.
Tested, still builds and runs. ok thfr@ > Index: Makefile > =================================================================== > RCS file: /home/cvs/ports/games/corsixth/Makefile,v > retrieving revision 1.14 > diff -u -p -u -p -r1.14 Makefile > --- Makefile 24 Apr 2023 11:40:39 -0000 1.14 > +++ Makefile 11 May 2023 04:10:30 -0000 > @@ -1,10 +1,9 @@ > ONLY_FOR_ARCHS = ${CXX11_ARCHS} > > -V = 0.65.1 > +V = 0.66 > COMMENT = open source clone of Theme Hospital > PKGNAME = corsixth-${V} > CATEGORIES = games x11 > -REVISION = 0 > > GH_ACCOUNT = CorsixTH > GH_PROJECT = CorsixTH > Index: distinfo > =================================================================== > RCS file: /home/cvs/ports/games/corsixth/distinfo,v > retrieving revision 1.7 > diff -u -p -u -p -r1.7 distinfo > --- distinfo 22 Jul 2021 20:25:14 -0000 1.7 > +++ distinfo 11 May 2023 04:10:39 -0000 > @@ -1,2 +1,2 @@ > -SHA256 (CorsixTH-0.65.1.tar.gz) = > uKFQM3H6DA89B9Ozmj3idpuO0lkj0NkxtwdbyI4/UI8= > -SIZE (CorsixTH-0.65.1.tar.gz) = 4163922 > +SHA256 (CorsixTH-0.66.tar.gz) = n4f/ACQFUBsSeYpxW2kUlndaT5cnGI7roWcUOBaZKg8= > +SIZE (CorsixTH-0.66.tar.gz) = 4117046 > Index: patches/patch-CorsixTH_Lua_app_lua > =================================================================== > RCS file: /home/cvs/ports/games/corsixth/patches/patch-CorsixTH_Lua_app_lua,v > retrieving revision 1.3 > diff -u -p -u -p -r1.3 patch-CorsixTH_Lua_app_lua > --- patches/patch-CorsixTH_Lua_app_lua 11 Mar 2022 19:04:13 -0000 > 1.3 > +++ patches/patch-CorsixTH_Lua_app_lua 11 May 2023 04:11:11 -0000 > @@ -3,7 +3,7 @@ Do not check or download updates. > Index: CorsixTH/Lua/app.lua > --- CorsixTH/Lua/app.lua.orig > +++ CorsixTH/Lua/app.lua > -@@ -64,7 +64,7 @@ function App:App() > +@@ -65,7 +65,7 @@ function App:App() > } > self.strings = {} > self.savegame_version = SAVEGAME_VERSION > Index: patches/patch-CorsixTH_Src_th_movie_cpp > =================================================================== > RCS file: patches/patch-CorsixTH_Src_th_movie_cpp > diff -N patches/patch-CorsixTH_Src_th_movie_cpp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-CorsixTH_Src_th_movie_cpp 11 May 2023 04:20:35 -0000 > @@ -0,0 +1,44 @@ > +Use ffmpeg 5.1 new channel layout api > + > +Index: CorsixTH/Src/th_movie.cpp > +--- CorsixTH/Src/th_movie.cpp.orig > ++++ CorsixTH/Src/th_movie.cpp > +@@ -446,9 +446,29 @@ void movie_player::play(int iChannel) { > + default: > + std::cerr << "WARN: unsupported channel layout " << mixer_channels > + << ". Please report issue."; > +- target_channel_layout = > av_get_default_channel_layout(mixer_channels); > ++ target_channel_layout = 0; > + } > + > ++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 24, 100) && \ > ++ LIBSWRESAMPLE_VERSION_INT >= AV_VERSION_INT(4, 5, 100) > ++ av_channel_layout_unique_ptr ch_layout(new AVChannelLayout{}); > ++ > ++ if (target_channel_layout == 0) { > ++ av_channel_layout_default(ch_layout.get(), mixer_channels); > ++ } else { > ++ av_channel_layout_from_mask(ch_layout.get(), target_channel_layout); > ++ } > ++ > ++ swr_alloc_set_opts2(&audio_resample_context, ch_layout.get(), > ++ AV_SAMPLE_FMT_S16, mixer_frequency, > ++ &(audio_codec_context->ch_layout), > ++ audio_codec_context->sample_fmt, > ++ audio_codec_context->sample_rate, 0, nullptr); > ++#else > ++ if (target_channel_layout == 0) { > ++ target_channel_layout = av_get_default_channel_layout(mixer_channels); > ++ } > ++ > + audio_resample_context = swr_alloc_set_opts( > + audio_resample_context, > + static_cast<std::int64_t>(target_channel_layout), AV_SAMPLE_FMT_S16, > +@@ -456,6 +476,7 @@ void movie_player::play(int iChannel) { > + static_cast<std::int64_t>(audio_codec_context->channel_layout), > + audio_codec_context->sample_fmt, audio_codec_context->sample_rate, > 0, > + nullptr); > ++#endif > + swr_init(audio_resample_context); > + empty_audio_chunk.reset( > + Mix_QuickLoad_RAW(audio_chunk_buffer.data(), > Index: patches/patch-CorsixTH_Src_th_movie_h > =================================================================== > RCS file: patches/patch-CorsixTH_Src_th_movie_h > diff -N patches/patch-CorsixTH_Src_th_movie_h > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-CorsixTH_Src_th_movie_h 11 May 2023 04:20:47 -0000 > @@ -0,0 +1,27 @@ > +Use ffmpeg 5.1 new channel layout api > + > +Index: CorsixTH/Src/th_movie.h > +--- CorsixTH/Src/th_movie.h.orig > ++++ CorsixTH/Src/th_movie.h > +@@ -96,6 +96,21 @@ class mix_chunk_deleter { > + > + using mix_chunk_unique_ptr = std::unique_ptr<Mix_Chunk, mix_chunk_deleter>; > + > ++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 24, 100) > ++//! \brief Functor for deleting AVChannelLayout > ++class av_channel_layout_deleter { > ++ public: > ++ void operator()(AVChannelLayout* c) { > ++ av_channel_layout_uninit(c); > ++ delete c; > ++ } > ++}; > ++ > ++//! \brief unique_ptr for AVChannelLayout > ++using av_channel_layout_unique_ptr = > ++ std::unique_ptr<AVChannelLayout, av_channel_layout_deleter>; > ++#endif > ++ > + //! \brief A picture in movie_picture_buffer > + //! > + //! Stores the picture from a frame in the movie from the time that it is >