I spotted this one in portroach, haven't tested beyond build yet but
the patch merges are fiddly enough that I thought I'd send it out to
avoid anyone doing duplicate work. Runtime tests welcome!
Index: Makefile
===================================================================
RCS file: /cvs/ports/multimedia/mpv/Makefile,v
retrieving revision 1.97
diff -u -p -r1.97 Makefile
--- Makefile 18 Jun 2023 04:46:33 -0000 1.97
+++ Makefile 24 Jul 2023 07:57:41 -0000
@@ -2,8 +2,7 @@ COMMENT = movie player based on MPlayer
GH_ACCOUNT = mpv-player
GH_PROJECT = mpv
-GH_TAGNAME = v0.35.1
-REVISION = 5
+GH_TAGNAME = v0.36.0
USE_NOBTCFI = Yes
SHARED_LIBS += mpv 1.0 # 2.0
@@ -70,6 +69,7 @@ CONFIGURE_ARGS = -Dlua=lua${MODLUA_DEP_V
-Dd3d11=disabled \
-Dd3d-hwaccel=disabled \
-Ddirect3d=disabled \
+ -Ddmabuf-wayland=disabled \
-Degl-android=disabled \
-Degl-angle=disabled \
-Degl-angle-lib=disabled \
@@ -83,6 +83,7 @@ CONFIGURE_ARGS = -Dlua=lua${MODLUA_DEP_V
-Dios-gl=disabled \
-Djack=disabled \
-Djavascript=disabled \
+ -Dlibplacebo-next=disabled \
-Dmacos-10-11-features=disabled \
-Dmacos-10-12-2-features=disabled \
-Dmacos-10-14-features=disabled \
@@ -112,6 +113,7 @@ CONFIGURE_ARGS = -Dlua=lua${MODLUA_DEP_V
-Dvdpau-gl-x11=disabled \
-Dvideotoolbox-gl=disabled \
-Dvulkan=disabled \
+ -Dvulkan-interop=disabled \
-Dwayland=disabled \
-Dwin32-internal-pthreads=disabled \
-Dwasapi=disabled
Index: distinfo
===================================================================
RCS file: /cvs/ports/multimedia/mpv/distinfo,v
retrieving revision 1.33
diff -u -p -r1.33 distinfo
--- distinfo 31 Jan 2023 10:19:28 -0000 1.33
+++ distinfo 24 Jul 2023 07:57:41 -0000
@@ -1,2 +1,2 @@
-SHA256 (mpv-0.35.1.tar.gz) = Qd+YG3uE4zou9EeKr4HW9PXIuc0sDTN6wUL8ILOH0ak=
-SIZE (mpv-0.35.1.tar.gz) = 3367913
+SHA256 (mpv-0.36.0.tar.gz) = KavET46+4BO7L5/hTYCzDbGbU0xnkFbkhRzq31pei/Y=
+SIZE (mpv-0.36.0.tar.gz) = 3409178
Index: patches/patch-audio_decode_ad_lavc_c
===================================================================
RCS file: patches/patch-audio_decode_ad_lavc_c
diff -N patches/patch-audio_decode_ad_lavc_c
--- patches/patch-audio_decode_ad_lavc_c 30 Jan 2023 16:53:55 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-- ffmpeg: update to handle deprecation of `av_init_packet`
- 4574dd5dc6ff75b1fc693afceec59fbcd51ccd4c
-
-Index: audio/decode/ad_lavc.c
---- audio/decode/ad_lavc.c.orig
-+++ audio/decode/ad_lavc.c
-@@ -46,6 +46,7 @@
- struct priv {
- AVCodecContext *avctx;
- AVFrame *avframe;
-+ AVPacket *avpkt;
- struct mp_chmap force_channel_map;
- uint32_t skip_samples, trim_samples;
- bool preroll_done;
-@@ -104,6 +105,7 @@ static bool init(struct mp_filter *da, struct mp_codec
- lavc_context = avcodec_alloc_context3(lavc_codec);
- ctx->avctx = lavc_context;
- ctx->avframe = av_frame_alloc();
-+ ctx->avpkt = av_packet_alloc();
- lavc_context->codec_type = AVMEDIA_TYPE_AUDIO;
- lavc_context->codec_id = lavc_codec->id;
- lavc_context->pkt_timebase = ctx->codec_timebase;
-@@ -160,6 +162,7 @@ static void destroy(struct mp_filter *da)
-
- avcodec_free_context(&ctx->avctx);
- av_frame_free(&ctx->avframe);
-+ mp_free_av_packet(&ctx->avpkt);
- }
-
- static void reset(struct mp_filter *da)
-@@ -185,10 +188,9 @@ static int send_packet(struct mp_filter *da, struct de
- if (mpkt && priv->next_pts == MP_NOPTS_VALUE)
- priv->next_pts = mpkt->pts;
-
-- AVPacket pkt;
-- mp_set_av_packet(&pkt, mpkt, &priv->codec_timebase);
-+ mp_set_av_packet(priv->avpkt, mpkt, &priv->codec_timebase);
-
-- int ret = avcodec_send_packet(avctx, mpkt ? &pkt : NULL);
-+ int ret = avcodec_send_packet(avctx, mpkt ? priv->avpkt : NULL);
- if (ret < 0)
- MP_ERR(da, "Error decoding audio.\n");
- return ret;
Index: patches/patch-audio_decode_ad_spdif_c
===================================================================
RCS file: patches/patch-audio_decode_ad_spdif_c
diff -N patches/patch-audio_decode_ad_spdif_c
--- patches/patch-audio_decode_ad_spdif_c 30 Jan 2023 16:53:55 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,53 +0,0 @@
-- ffmpeg: update to handle deprecation of `av_init_packet`
- 4574dd5dc6ff75b1fc693afceec59fbcd51ccd4c
-
-Index: audio/decode/ad_spdif.c
---- audio/decode/ad_spdif.c.orig
-+++ audio/decode/ad_spdif.c
-@@ -41,6 +41,7 @@ struct spdifContext {
- struct mp_log *log;
- enum AVCodecID codec_id;
- AVFormatContext *lavf_ctx;
-+ AVPacket *avpkt;
- int out_buffer_len;
- uint8_t out_buffer[OUTBUF_SIZE];
- bool need_close;
-@@ -82,6 +83,7 @@ static void destroy(struct mp_filter *da)
- avformat_free_context(lavf_ctx);
- spdif_ctx->lavf_ctx = NULL;
- }
-+ mp_free_av_packet(&spdif_ctx->avpkt);
- }
-
- static void determine_codec_params(struct mp_filter *da, AVPacket *pkt,
-@@ -295,15 +297,14 @@ static void process(struct mp_filter *da)
- struct mp_aframe *out = NULL;
- double pts = mpkt->pts;
-
-- AVPacket pkt;
-- mp_set_av_packet(&pkt, mpkt, NULL);
-- pkt.pts = pkt.dts = 0;
-+ mp_set_av_packet(spdif_ctx->avpkt, mpkt, NULL);
-+ spdif_ctx->avpkt->pts = spdif_ctx->avpkt->dts = 0;
- if (!spdif_ctx->lavf_ctx) {
-- if (init_filter(da, &pkt) < 0)
-+ if (init_filter(da, spdif_ctx->avpkt) < 0)
- goto done;
- }
- spdif_ctx->out_buffer_len = 0;
-- int ret = av_write_frame(spdif_ctx->lavf_ctx, &pkt);
-+ int ret = av_write_frame(spdif_ctx->lavf_ctx, spdif_ctx->avpkt);
- avio_flush(spdif_ctx->lavf_ctx->pb);
- if (ret < 0) {
- MP_ERR(da, "spdif mux error: '%s'\n", mp_strerror(AVUNERROR(ret)));
-@@ -424,6 +425,10 @@ static struct mp_decoder *create(struct mp_filter *par
- talloc_free(da);
- return NULL;
- }
-+
-+ spdif_ctx->avpkt = av_packet_alloc();
-+ MP_HANDLE_OOM(spdif_ctx->avpkt);
-+
- return &spdif_ctx->public;
- }
-
Index: patches/patch-audio_out_ao_sndio_c
===================================================================
RCS file: patches/patch-audio_out_ao_sndio_c
diff -N patches/patch-audio_out_ao_sndio_c
--- patches/patch-audio_out_ao_sndio_c 20 Nov 2022 07:22:59 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-Use sio_flush() instead of sio_stop() to improve controls responsiveness
-
-Index: audio/out/ao_sndio.c
---- audio/out/ao_sndio.c.orig
-+++ audio/out/ao_sndio.c
-@@ -237,8 +237,8 @@ static void reset(struct ao *ao)
- if (p->playing) {
- p->playing = false;
-
-- if (!sio_stop(p->hdl)) {
-- MP_ERR(ao, "reset: couldn't sio_stop()\n");
-+ if (!sio_flush(p->hdl)) {
-+ MP_ERR(ao, "reset: couldn't sio_flush()\n");
- }
- p->delay = 0;
- if (!sio_start(p->hdl)) {
Index: patches/patch-common_av_common_c
===================================================================
RCS file: patches/patch-common_av_common_c
diff -N patches/patch-common_av_common_c
--- patches/patch-common_av_common_c 30 Jan 2023 16:53:55 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-- ffmpeg: update to handle deprecation of `av_init_packet`
- 4574dd5dc6ff75b1fc693afceec59fbcd51ccd4c
-
-Index: common/av_common.c
---- common/av_common.c.orig
-+++ common/av_common.c
-@@ -196,7 +196,11 @@ double mp_pts_from_av(int64_t av_pts, AVRational *tb)
- // Set duration field only if tb is set.
- void mp_set_av_packet(AVPacket *dst, struct demux_packet *mpkt, AVRational *tb)
- {
-- av_init_packet(dst);
-+ dst->side_data = NULL;
-+ dst->side_data_elems = 0;
-+ dst->buf = NULL;
-+ av_packet_unref(dst);
-+
- dst->data = mpkt ? mpkt->buffer : NULL;
- dst->size = mpkt ? mpkt->len : 0;
- /* Some codecs (ZeroCodec, some cases of PNG) may want keyframe info
-@@ -393,4 +397,22 @@ int mp_set_avopts_pos(struct mp_log *log, void *avobj,
- }
- }
- return success;
-+}
-+
-+/**
-+ * Must be used to free an AVPacket that was used with mp_set_av_packet().
-+ *
-+ * We have a particular pattern where we "borrow" buffers and set them
-+ * into an AVPacket to pass data to ffmpeg without extra copies.
-+ * This applies to buf and side_data, so this function clears them before
-+ * freeing.
-+ */
-+void mp_free_av_packet(AVPacket **pkt)
-+{
-+ if (*pkt) {
-+ (*pkt)->side_data = NULL;
-+ (*pkt)->side_data_elems = 0;
-+ (*pkt)->buf = NULL;
-+ }
-+ av_packet_free(pkt);
- }
Index: patches/patch-common_av_common_h
===================================================================
RCS file: patches/patch-common_av_common_h
diff -N patches/patch-common_av_common_h
--- patches/patch-common_av_common_h 30 Jan 2023 16:53:55 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-- ffmpeg: update to handle deprecation of `av_init_packet`
- 4574dd5dc6ff75b1fc693afceec59fbcd51ccd4c
-
-Index: common/av_common.h
---- common/av_common.h.orig
-+++ common/av_common.h
-@@ -50,5 +50,6 @@ void mp_set_avdict(struct AVDictionary **dict, char **
- void mp_avdict_print_unset(struct mp_log *log, int msgl, struct AVDictionary *d);
- int mp_set_avopts(struct mp_log *log, void *avobj, char **kv);
- int mp_set_avopts_pos(struct mp_log *log, void *avobj, void *posargs, char **kv);
-+void mp_free_av_packet(AVPacket **pkt);
-
-
No comments:
Post a Comment