From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8693E158164 for ; Sat, 13 May 2023 22:52:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 88EFCE0826; Sat, 13 May 2023 22:52:13 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 67565E0826 for ; Sat, 13 May 2023 22:52:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 64520340F0B for ; Sat, 13 May 2023 22:52:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C4FA0A5A for ; Sat, 13 May 2023 22:52:10 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1684018153.a15de2a067817db7ed034d0c12b7c7c3ba83e7b9.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/vlc/, media-video/vlc/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/vlc/files/vlc-3.0.18-flac-crc.patch media-video/vlc/vlc-3.0.18-r1.ebuild X-VCS-Directories: media-video/vlc/files/ media-video/vlc/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: a15de2a067817db7ed034d0c12b7c7c3ba83e7b9 X-VCS-Branch: master Date: Sat, 13 May 2023 22:52:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: aa3e5080-e6a5-49a3-9b71-3fdf378fbb9a X-Archives-Hash: 7e64d203835a413e2d93bf7406a82e70 commit: a15de2a067817db7ed034d0c12b7c7c3ba83e7b9 Author: Sam James gentoo org> AuthorDate: Sat May 13 22:42:45 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sat May 13 22:49:13 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a15de2a0 media-video/vlc: backport FLAC CRC fix Closes: https://bugs.gentoo.org/903665 Signed-off-by: Sam James gentoo.org> media-video/vlc/files/vlc-3.0.18-flac-crc.patch | 90 ++++ media-video/vlc/vlc-3.0.18-r1.ebuild | 518 ++++++++++++++++++++++++ 2 files changed, 608 insertions(+) diff --git a/media-video/vlc/files/vlc-3.0.18-flac-crc.patch b/media-video/vlc/files/vlc-3.0.18-flac-crc.patch new file mode 100644 index 000000000000..5e4d896bc7e7 --- /dev/null +++ b/media-video/vlc/files/vlc-3.0.18-flac-crc.patch @@ -0,0 +1,90 @@ +https://bugs.gentoo.org/903665 +https://code.videolan.org/videolan/vlc/-/commit/c2dd4bfefe079e49db1789eb76be3885e4fc31b4 + +(changed VLC_TICKS_INVALID -> VLC_TS_INVALID to avoid needing https://code.videolan.org/videolan/vlc/-/commit/0b4dff80ac381dd7de75125c70145a206a01eed8 too.) + +From c2dd4bfefe079e49db1789eb76be3885e4fc31b4 Mon Sep 17 00:00:00 2001 +From: Francois Cartegnie +Date: Mon, 7 Nov 2022 15:02:57 +0100 +Subject: [PATCH] packetizer: flac: fix CRC from emulated sync + +also skips some memcpy + +refs #27454 #27477 + +(cherry picked from commit c14b5aa6a7bd3aa25fa951e2b4136aff70f5702a) +--- a/modules/packetizer/flac.c ++++ b/modules/packetizer/flac.c +@@ -78,6 +78,7 @@ struct decoder_sys_t + + size_t i_last_frame_size; + uint16_t crc; ++ size_t i_buf_offset; /* in final buffer before crc check / validation / retry */ + size_t i_buf; + uint8_t *p_buf; + +@@ -386,6 +387,7 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block) + p_sys->headerinfo = headerinfo; + p_sys->i_state = STATE_NEXT_SYNC; + p_sys->i_offset = FLAC_FRAME_SIZE_MIN; ++ p_sys->i_buf_offset = 0; + p_sys->crc = 0; + + /* We have to read until next frame sync code to compute current frame size +@@ -461,6 +463,7 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block) + block_SkipBytes( &p_sys->bytestream, FLAC_HEADER_SIZE_MAX + 2 ); + block_BytestreamFlush( &p_sys->bytestream ); + p_sys->crc = 0; ++ p_sys->i_buf_offset = 0; + p_sys->i_offset = 0; + p_sys->i_state = STATE_NOSYNC; + p_sys->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY; +@@ -484,10 +487,12 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block) + } + + /* Copy from previous sync point up to to current (offset) */ +- block_PeekOffsetBytes( &p_sys->bytestream, 0, p_sys->p_buf, p_sys->i_offset ); ++ block_PeekOffsetBytes( &p_sys->bytestream, p_sys->i_buf_offset, ++ &p_sys->p_buf[p_sys->i_buf_offset], ++ p_sys->i_offset - p_sys->i_buf_offset ); + + /* update crc to include this data chunk */ +- for( size_t i = 0; i < p_sys->i_offset - 2; i++ ) ++ for( size_t i = p_sys->i_buf_offset; i < p_sys->i_offset - 2; i++ ) + p_sys->crc = flac_crc16( p_sys->crc, p_sys->p_buf[i] ); + + uint16_t stream_crc = GetWBE(&p_sys->p_buf[p_sys->i_offset - 2]); +@@ -497,6 +502,7 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block) + /* Add the 2 last bytes which were not the CRC sum, and go for next sync point */ + p_sys->crc = flac_crc16( p_sys->crc, p_sys->p_buf[p_sys->i_offset - 2] ); + p_sys->crc = flac_crc16( p_sys->crc, p_sys->p_buf[p_sys->i_offset - 1] ); ++ p_sys->i_buf_offset = p_sys->i_offset; + p_sys->i_offset += 1; + p_sys->i_state = !pp_block ? STATE_NOSYNC : STATE_NEXT_SYNC; + break; /* continue */ +@@ -513,6 +519,7 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block) + block_BytestreamFlush( &p_sys->bytestream ); + p_sys->i_offset = 0; + p_sys->crc = 0; ++ p_sys->i_buf_offset = 0; + + if( block_BytestreamRemaining(&p_sys->bytestream) > 0 || pp_block == NULL /* drain */) + p_sys->i_state = STATE_SEND_DATA; +@@ -553,6 +560,7 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block) + else + free( p_sys->p_buf ); + ++ p_sys->i_buf_offset = 0; + p_sys->i_buf = 0; + p_sys->p_buf = NULL; + p_sys->i_offset = 0; +@@ -587,6 +595,7 @@ static int Open(vlc_object_t *p_this) + p_sys->b_stream_info = false; + p_sys->i_last_frame_size = FLAC_FRAME_SIZE_MIN; + p_sys->headerinfo.i_pts = VLC_TS_INVALID; ++ p_sys->i_buf_offset = 0; + p_sys->i_buf = 0; + p_sys->p_buf = NULL; + p_sys->i_next_block_flags = 0; +-- +GitLab diff --git a/media-video/vlc/vlc-3.0.18-r1.ebuild b/media-video/vlc/vlc-3.0.18-r1.ebuild new file mode 100644 index 000000000000..789436d0b1c3 --- /dev/null +++ b/media-video/vlc/vlc-3.0.18-r1.ebuild @@ -0,0 +1,518 @@ +# Copyright 2000-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1..2} ) + +MY_PV="${PV/_/-}" +MY_PV="${MY_PV/-beta/-test}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} = *9999 ]] ; then + if [[ ${PV%.9999} != ${PV} ]] ; then + EGIT_BRANCH="3.0.x" + fi + EGIT_REPO_URI="https://code.videolan.org/videolan/vlc.git" + inherit git-r3 +else + if [[ ${MY_P} = ${P} ]] ; then + SRC_URI="https://download.videolan.org/pub/videolan/${PN}/${PV}/${P}.tar.xz" + else + SRC_URI="https://download.videolan.org/pub/videolan/testing/${MY_P}/${MY_P}.tar.xz" + fi + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv -sparc ~x86" +fi +inherit autotools flag-o-matic lua-single toolchain-funcs virtualx xdg + +DESCRIPTION="Media player and framework with support for most multimedia files and streaming" +HOMEPAGE="https://www.videolan.org/vlc/" + +LICENSE="LGPL-2.1 GPL-2" +SLOT="0/5-9" # vlc - vlccore + +IUSE="a52 alsa aom archive aribsub bidi bluray cddb chromaprint chromecast dav1d dbus + dc1394 debug directx dts +dvbpsi dvd +encode faad fdk +ffmpeg flac fluidsynth + fontconfig +gcrypt gme gnome-keyring gstreamer +gui ieee1394 jack jpeg kate + libass libcaca libnotify +libsamplerate libtar libtiger linsys lirc live lua + macosx-notifications mad matroska modplug mp3 mpeg mtp musepack ncurses nfs ogg + omxil optimisememory opus png projectm pulseaudio rdp run-as-root samba sdl-image + sftp shout sid skins soxr speex srt ssl svg taglib theora tremor truetype twolame + udev upnp vaapi v4l vdpau vnc vpx wayland +X x264 x265 xml zeroconf zvbi + cpu_flags_arm_neon cpu_flags_ppc_altivec cpu_flags_x86_mmx cpu_flags_x86_sse +" +REQUIRED_USE=" + chromecast? ( encode ) + directx? ( ffmpeg ) + fontconfig? ( truetype ) + libcaca? ( X ) + libtar? ( skins ) + libtiger? ( kate ) + lua? ( ${LUA_REQUIRED_USE} ) + skins? ( gui truetype X xml ) + ssl? ( gcrypt ) + vaapi? ( ffmpeg X ) + vdpau? ( ffmpeg X ) +" +BDEPEND=" + >=sys-devel/gettext-0.19.8 + virtual/pkgconfig + lua? ( ${LUA_DEPS} ) + amd64? ( dev-lang/yasm ) + x86? ( dev-lang/yasm ) +" +# =gcc 4.8.0. bug #499996 + append-cflags $(test-flags-CC -fno-stack-check) + # Bug 569774 + replace-flags -Os -O2 + fi + + if use omxil; then + # bug #723006 + # https://trac.videolan.org/vlc/ticket/24617 + append-cflags -fcommon + fi + + # FIXME: Needs libresid-builder from libsidplay:2 which is in another directory... + append-ldflags "-L${ESYSROOT}/usr/$(get_libdir)/sidplay/builders/" + + if use riscv; then + # bug #803473 + append-libs -latomic + fi + + if use truetype || use bidi; then + myeconfargs+=( --enable-freetype ) + else + myeconfargs+=( --disable-freetype ) + fi + + if use truetype || use projectm; then + local dejavu="${EPREFIX}/usr/share/fonts/dejavu/" + myeconfargs+=( + --with-default-font=${dejavu}/DejaVuSans.ttf + --with-default-font-family=Sans + --with-default-monospace-font=${dejavu}/DejaVuSansMono.ttf + --with-default-monospace-font-family=Monospace + ) + fi + + econf "${myeconfargs[@]}" + + # _FORTIFY_SOURCE is set to 2 in config.h, which is also the default value on Gentoo. + # Other values may break the build (bug 523144), so definition should not be removed. + # To prevent redefinition warnings, we undefine _FORTIFY_SOURCE at the start of config.h + sed -i '1i#undef _FORTIFY_SOURCE' config.h || die +} + +src_test() { + virtx emake check-TESTS +} + +src_install() { + default + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + if [[ -z "${ROOT}" ]] && [[ -x "${EROOT}/usr/$(get_libdir)/vlc/vlc-cache-gen" ]] ; then + einfo "Running ${EPREFIX}/usr/$(get_libdir)/vlc/vlc-cache-gen on ${EROOT}/usr/$(get_libdir)/vlc/plugins/" + "${EPREFIX}/usr/$(get_libdir)/vlc/vlc-cache-gen" "${EROOT}/usr/$(get_libdir)/vlc/plugins/" + else + ewarn "We cannot run vlc-cache-gen (most likely ROOT != /)" + ewarn "Please run ${EPREFIX}/usr/$(get_libdir)/vlc/vlc-cache-gen manually" + ewarn "If you do not do it, vlc will take a long time to load." + fi + + xdg_pkg_postinst +} + +pkg_postrm() { + if [[ -e "${EROOT}"/usr/$(get_libdir)/vlc/plugins/plugins.dat ]]; then + rm "${EROOT}"/usr/$(get_libdir)/vlc/plugins/plugins.dat || die "Failed to rm plugins.dat" + fi + + xdg_pkg_postrm +}