From nobody Sat Aug 19 10:30:41 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RSZl5318yz4qXKG; Sat, 19 Aug 2023 10:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RSZl52JLMz3Kjk; Sat, 19 Aug 2023 10:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692441041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4YPVRRmHPzbxpwCO63rMkQWAjQcxBeTj94PMsEjkM18=; b=m8VuQvZjs0TR6YLGN1wiXSkRFUaliuVGjK8XlotdnwsVteRIESpBB2os6O0agW9OdcI3rT HSBp8Fo6JvK/izbPS34/Elnwbo7lvuEfrQc/3jbevxmRZPkRL3l0Lk24DN7RWgK3XAH8Yo sqnQonAp/qVKBQVinPD77hbZpuIWcELdvwD/nbm92qDN0+TlTom/+LBOZcdy2PSVzNetWA owSVhz9RYm/mviXo6gtfX+z6yNIzo3zCj5F/UrMglwLimw9HVMREaL64npZPXjwxDRMXO7 86lmL2sw1zRpfr7cMcM6dCUsDP3efsFdiGi5LP/0jS6Jh8BAvErh4xrixgKjDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692441041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4YPVRRmHPzbxpwCO63rMkQWAjQcxBeTj94PMsEjkM18=; b=rUJGuK8NiJ19nUduAp3ALIwkTx4tiYxTSj2zPZF/PPnndzTkVILPb6kHVx5TnUlwxNwgZp ZGthvmcjsNUnWzH9cuyJi1n4CqHC6au+oiZ+SKiDRG/kcd9auIomhbYVcN2ncBersG80SY pe932LMy6Y+Xkc3U8lLAJN+zgC1/UTpeSrvK9NXs3a5qH5hfhSymH4lJBEbD/tNAl4yyOF /lQWVepT65Wm4J30MvAraLi0spQlOsSBCkAgiW0jYVESmLv7ECRvUq9Hd+lKgEF9OIh7s9 koq/6CS2PUGPFS1+AHyVJZaC7UeRq0h6mbS3U+WI0m01vzqgYu4SyLsCEhhalw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692441041; a=rsa-sha256; cv=none; b=L945BdoXuTqQFNaOPSOdO4KU+KTeUXL1+UE8dG3Ds7p+YEoCUq5UcGgWNVspLgOIVzieRF hmjlFjuX2IBSxIzXhADn89wGFm+OvR4uhkby5eLvCMKuNAIXzhs1eNkHkC5M719EkoVPuh dlnMnlZBj767b4P9BzyMUsB7J6TBxApptNr6Jz8FwgASCu4Z6RjlbW/qJy9qwzzDEOYP6X Pwg0xpwKojcYYSbHPDAgDszwB3PGkpjdqzYAeEKBGkUOXkDlBHNvp2FESv7LKojdoQazlL do6ij3SOvhuM95YEMMYZYQ/mC4dwohJSQAhfL8DezhxCZivt0QuACfScb58i7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RSZl51N5Hzv4B; Sat, 19 Aug 2023 10:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37JAUft6045440; Sat, 19 Aug 2023 10:30:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37JAUfsn045437; Sat, 19 Aug 2023 10:30:41 GMT (envelope-from git) Date: Sat, 19 Aug 2023 10:30:41 GMT Message-Id: <202308191030.37JAUfsn045437@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dirk Meyer Subject: git: c87a8f657e22 - main - audio/owntone: Circumvent ffmpeg 6 ALAC encoding problem List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dinoex X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c87a8f657e226c7a6bbb03300485400d07b34848 Auto-Submitted: auto-generated The branch main has been updated by dinoex: URL: https://cgit.FreeBSD.org/ports/commit/?id=c87a8f657e226c7a6bbb03300485400d07b34848 commit c87a8f657e226c7a6bbb03300485400d07b34848 Author: Dirk Meyer AuthorDate: 2023-08-19 10:30:08 +0000 Commit: Dirk Meyer CommitDate: 2023-08-19 10:30:08 +0000 audio/owntone: Circumvent ffmpeg 6 ALAC encoding problem https://github.com/owntone/owntone-server/issues/1640 --- audio/owntone/Makefile | 2 +- audio/owntone/files/patch-src_transcode.c | 43 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/audio/owntone/Makefile b/audio/owntone/Makefile index 35d0826552b7..2a127e501a5c 100644 --- a/audio/owntone/Makefile +++ b/audio/owntone/Makefile @@ -1,6 +1,6 @@ PORTNAME= owntone DISTVERSION= 28.5 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= audio MASTER_SITES= https://github.com/owntone/owntone-server/releases/download/${DISTVERSION}/ diff --git a/audio/owntone/files/patch-src_transcode.c b/audio/owntone/files/patch-src_transcode.c new file mode 100644 index 000000000000..a32c41f7c0ab --- /dev/null +++ b/audio/owntone/files/patch-src_transcode.c @@ -0,0 +1,43 @@ +From 941fab9023f0af19f178771effd2a73865e849ba Mon Sep 17 00:00:00 2001 +From: ejurgensen +Date: Thu, 17 Aug 2023 23:09:41 +0200 +Subject: [PATCH] [xcode] Circumvent ffmpeg 6 ALAC encoding problem + +The default ffmpeg ALAC encoder, "alac", requires fixed frames of size 4096, +but the Airplay 2 implementation feeds it with frames of size 352. Before +ffmpeg 6 this worked, but not any more. Seems a frame size check has been +added. + +This commit doesn't fix this, but circumvents the ffmpeg error by modifying the +frame size that ffmpeg checks. + +Fixes issue #1640 + +--- src/transcode.c.orig 2022-01-29 16:41:27 UTC ++++ src/transcode.c +@@ -42,6 +42,8 @@ + #include "misc.h" + #include "transcode.h" + ++#define USE_ALAC_FRAME_SIZE_HACK (LIBAVCODEC_VERSION_MAJOR > 59) || ((LIBAVCODEC_VERSION_MAJOR == 59) && (LIBAVCODEC_VERSION_MINOR > 31)) ++ + // Interval between ICY metadata checks for streams, in seconds + #define METADATA_ICY_INTERVAL 5 + // Maximum number of streams in a file that we will accept +@@ -506,6 +508,16 @@ stream_add(struct encode_ctx *ctx, struct stream_ctx * + avcodec_free_context(&s->codec); + return -1; + } ++ ++ // airplay.c "misuses" the ffmpeg alac encoder in that it pushes frames with ++ // 352 samples even though the encoder wants 4096 (and doesn't have variable ++ // frame capability). This worked with no issues until ffmpeg 6, where it ++ // seems a frame size check was added. The below circumvents the check, but is ++ // dirty because we shouldn't be writing to this data element. ++#if USE_ALAC_FRAME_SIZE_HACK ++ if (codec_id == AV_CODEC_ID_ALAC) ++ s->codec->frame_size = 352; ++#endif + + // Copy the codec parameters we just set to the stream, so the muxer knows them + ret = avcodec_parameters_from_context(s->stream->codecpar, s->codec);