init
This commit is contained in:
+366
@@ -0,0 +1,366 @@
|
|||||||
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.15 as buildstage
|
||||||
|
############## build stage ##############
|
||||||
|
|
||||||
|
# package versions
|
||||||
|
ARG ARGTABLE_VER="2.13"
|
||||||
|
ARG XMLTV_VER="v1.0.0"
|
||||||
|
|
||||||
|
# environment settings
|
||||||
|
ARG TZ="Europe/Oslo"
|
||||||
|
ARG TVHEADEND_COMMIT
|
||||||
|
ENV HOME="/config"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install build packages ****" && \
|
||||||
|
apk add --no-cache \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
bsd-compat-headers \
|
||||||
|
bzip2 \
|
||||||
|
cmake \
|
||||||
|
curl \
|
||||||
|
ffmpeg-dev \
|
||||||
|
file \
|
||||||
|
findutils \
|
||||||
|
g++ \
|
||||||
|
gcc \
|
||||||
|
gettext-dev \
|
||||||
|
git \
|
||||||
|
gnu-libiconv-dev \
|
||||||
|
gzip \
|
||||||
|
jq \
|
||||||
|
libcurl \
|
||||||
|
libgcrypt-dev \
|
||||||
|
libhdhomerun-dev \
|
||||||
|
libtool \
|
||||||
|
libva-dev \
|
||||||
|
libvpx-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libxslt-dev \
|
||||||
|
linux-headers \
|
||||||
|
make \
|
||||||
|
openssl-dev \
|
||||||
|
opus-dev \
|
||||||
|
patch \
|
||||||
|
pcre2-dev \
|
||||||
|
perl-archive-zip \
|
||||||
|
perl-boolean \
|
||||||
|
perl-capture-tiny \
|
||||||
|
perl-cgi \
|
||||||
|
perl-compress-raw-zlib \
|
||||||
|
perl-date-manip \
|
||||||
|
perl-datetime \
|
||||||
|
perl-datetime-format-strptime \
|
||||||
|
perl-datetime-timezone \
|
||||||
|
perl-dbd-sqlite \
|
||||||
|
perl-dbi \
|
||||||
|
perl-dev \
|
||||||
|
perl-digest-sha1 \
|
||||||
|
perl-doc \
|
||||||
|
perl-file-slurp \
|
||||||
|
perl-file-temp \
|
||||||
|
perl-file-which \
|
||||||
|
perl-getopt-long \
|
||||||
|
perl-html-parser \
|
||||||
|
perl-html-tree \
|
||||||
|
perl-http-cookies \
|
||||||
|
perl-io \
|
||||||
|
perl-io-html \
|
||||||
|
perl-io-socket-ssl \
|
||||||
|
perl-io-stringy \
|
||||||
|
perl-json \
|
||||||
|
perl-json-xs \
|
||||||
|
perl-libwww \
|
||||||
|
perl-lingua-en-numbers-ordinate \
|
||||||
|
perl-lingua-preferred \
|
||||||
|
perl-list-moreutils \
|
||||||
|
perl-lwp-useragent-determined \
|
||||||
|
perl-module-build \
|
||||||
|
perl-module-pluggable \
|
||||||
|
perl-net-ssleay \
|
||||||
|
perl-parse-recdescent \
|
||||||
|
perl-path-class \
|
||||||
|
perl-scalar-list-utils \
|
||||||
|
perl-term-progressbar \
|
||||||
|
perl-term-readkey \
|
||||||
|
perl-test-exception \
|
||||||
|
perl-test-requires \
|
||||||
|
perl-timedate \
|
||||||
|
perl-try-tiny \
|
||||||
|
perl-unicode-string \
|
||||||
|
perl-xml-libxml \
|
||||||
|
perl-xml-libxslt \
|
||||||
|
perl-xml-parser \
|
||||||
|
perl-xml-sax \
|
||||||
|
perl-xml-treepp \
|
||||||
|
perl-xml-twig \
|
||||||
|
perl-xml-writer \
|
||||||
|
pkgconf \
|
||||||
|
pngquant \
|
||||||
|
python3 \
|
||||||
|
sdl-dev \
|
||||||
|
tar \
|
||||||
|
uriparser-dev \
|
||||||
|
wget \
|
||||||
|
x264-dev \
|
||||||
|
x265-dev \
|
||||||
|
zlib-dev
|
||||||
|
|
||||||
|
#Download linuxserver/tvheadend git
|
||||||
|
RUN \
|
||||||
|
echo "**** download linuxserver/docker-tvheadend ****" && \
|
||||||
|
git clone https://github.com/linuxserver/docker-tvheadend.git /tmp/docker-tvheadend
|
||||||
|
|
||||||
|
# copy patches
|
||||||
|
COPY patches/ /tmp/patches/
|
||||||
|
RUN \
|
||||||
|
echo "**** move patches ****" && \
|
||||||
|
mv /tmp/docker-tvheadend/patches/* /tmp/patches/
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** remove musl iconv.h and replace with gnu-iconv.h ****" && \
|
||||||
|
rm -rf /usr/include/iconv.h && \
|
||||||
|
cp /usr/include/gnu-libiconv/iconv.h /usr/include/iconv.h
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install perl modules for xmltv ****" && \
|
||||||
|
curl -s -L https://cpanmin.us | perl - App::cpanminus && \
|
||||||
|
cpanm --installdeps /tmp/patches
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** compile XMLTV ****" && \
|
||||||
|
git clone https://github.com/XMLTV/xmltv.git /tmp/xmltv && \
|
||||||
|
cd /tmp/xmltv && \
|
||||||
|
git checkout ${XMLTV_VER} && \
|
||||||
|
echo "**** Perl 5.26 fixes for XMTLV ****" && \
|
||||||
|
sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_latex && \
|
||||||
|
sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_text && \
|
||||||
|
sed "s/\(lib\/set_share_dir.pl';\)/.\/\1/" -i grab/it/tv_grab_it.PL && \
|
||||||
|
sed "s/\(filter\/Grep.pm';\)/.\/\1/" -i filter/tv_grep.PL && \
|
||||||
|
sed "s/\(lib\/XMLTV.pm.in';\)/.\/\1/" -i lib/XMLTV.pm.PL && \
|
||||||
|
sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL && \
|
||||||
|
PERL5LIB=`pwd` && \
|
||||||
|
echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make test && \
|
||||||
|
make DESTDIR=/tmp/xmltv-build install
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** build libdvbcsa ****" && \
|
||||||
|
git clone https://github.com/glenvt18/libdvbcsa.git /tmp/libdvbcsa && \
|
||||||
|
cd /tmp/libdvbcsa && \
|
||||||
|
git apply /tmp/patches/libdvbcsa.patch && \
|
||||||
|
./bootstrap && \
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--sysconfdir=/etc \
|
||||||
|
--mandir=/usr/share/man \
|
||||||
|
--infodir=/usr/share/info \
|
||||||
|
--localstatedir=/var && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make check && \
|
||||||
|
make DESTDIR=/tmp/libdvbcsa-build install && \
|
||||||
|
echo "**** copy to /usr for tvheadend dependency ****" && \
|
||||||
|
cp -pr /tmp/libdvbcsa-build/usr/* /usr/
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** build tvheadend ****" && \
|
||||||
|
if [ -z ${TVHEADEND_COMMIT+x} ]; then \
|
||||||
|
TVHEADEND_COMMIT=$(curl -sX GET https://api.github.com/repos/tvheadend/tvheadend/commits/master \
|
||||||
|
| jq -r '. | .sha'); \
|
||||||
|
fi && \
|
||||||
|
mkdir -p \
|
||||||
|
/tmp/tvheadend && \
|
||||||
|
git clone https://github.com/tvheadend/tvheadend.git /tmp/tvheadend && \
|
||||||
|
cd /tmp/tvheadend && \
|
||||||
|
git checkout ${TVHEADEND_COMMIT} && \
|
||||||
|
echo "**** patch tvheadend ****" && \
|
||||||
|
git apply /tmp/patches/tvheadend43.patch && \
|
||||||
|
echo "**** configure tvheadend ****" && \
|
||||||
|
./configure \
|
||||||
|
`#Encoding` \
|
||||||
|
--disable-ffmpeg_static \
|
||||||
|
--disable-libfdkaac_static \
|
||||||
|
--disable-libtheora_static \
|
||||||
|
--disable-libopus_static \
|
||||||
|
--disable-libvorbis_static \
|
||||||
|
--disable-libvpx_static \
|
||||||
|
--disable-libx264_static \
|
||||||
|
--disable-libx265_static \
|
||||||
|
--disable-libfdkaac \
|
||||||
|
--enable-libopus \
|
||||||
|
--enable-libvorbis \
|
||||||
|
--enable-libvpx \
|
||||||
|
--enable-libx264 \
|
||||||
|
--enable-libx265 \
|
||||||
|
\
|
||||||
|
`#Options` \
|
||||||
|
--disable-avahi \
|
||||||
|
--disable-dbus_1 \
|
||||||
|
--disable-bintray_cache \
|
||||||
|
--disable-execinfo \
|
||||||
|
--disable-hdhomerun_static \
|
||||||
|
--enable-hdhomerun_client \
|
||||||
|
--enable-libav \
|
||||||
|
--enable-pngquant \
|
||||||
|
--enable-trace \
|
||||||
|
--enable-vaapi \
|
||||||
|
--infodir=/usr/share/info \
|
||||||
|
--localstatedir=/var \
|
||||||
|
--mandir=/usr/share/man \
|
||||||
|
--prefix=/usr \
|
||||||
|
--python=python3 \
|
||||||
|
--sysconfdir=/config && \
|
||||||
|
echo "**** compile tvheadend ****" && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make DESTDIR=/tmp/tvheadend-build install
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** compile argtable2 ****" && \
|
||||||
|
ARGTABLE_VER1="${ARGTABLE_VER//./-}" && \
|
||||||
|
mkdir -p \
|
||||||
|
/tmp/argtable && \
|
||||||
|
curl -s -o \
|
||||||
|
/tmp/argtable-src.tar.gz -L \
|
||||||
|
"https://sourceforge.net/projects/argtable/files/argtable/argtable-${ARGTABLE_VER}/argtable${ARGTABLE_VER1}.tar.gz" && \
|
||||||
|
tar xf \
|
||||||
|
/tmp/argtable-src.tar.gz -C \
|
||||||
|
/tmp/argtable --strip-components=1 && \
|
||||||
|
cp /tmp/patches/config.* /tmp/argtable && \
|
||||||
|
cd /tmp/argtable && \
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make check && \
|
||||||
|
make DESTDIR=/tmp/argtable-build install && \
|
||||||
|
echo "**** copy to /usr for comskip dependency ****" && \
|
||||||
|
cp -pr /tmp/argtable-build/usr/* /usr/
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "***** compile comskip ****" && \
|
||||||
|
git clone https://github.com/erikkaashoek/Comskip /tmp/comskip && \
|
||||||
|
cd /tmp/comskip && \
|
||||||
|
./autogen.sh && \
|
||||||
|
./configure \
|
||||||
|
--bindir=/usr/bin \
|
||||||
|
--sysconfdir=/config/comskip && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make DESTDIR=/tmp/comskip-build install
|
||||||
|
|
||||||
|
############## picons stage ##############
|
||||||
|
# built by https://github.com/linuxserver/picons-builder
|
||||||
|
FROM ghcr.io/linuxserver/picons-builder as piconsstage
|
||||||
|
|
||||||
|
|
||||||
|
############## runtime stage ##############
|
||||||
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.15
|
||||||
|
|
||||||
|
# set version label
|
||||||
|
ARG BUILD_DATE
|
||||||
|
ARG VERSION
|
||||||
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
|
LABEL maintainer="saarg"
|
||||||
|
|
||||||
|
# environment settings
|
||||||
|
ENV HOME="/config"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install runtime packages ****" && \
|
||||||
|
apk add --no-cache \
|
||||||
|
bsd-compat-headers \
|
||||||
|
bzip2 \
|
||||||
|
curl \
|
||||||
|
ffmpeg \
|
||||||
|
ffmpeg-libs \
|
||||||
|
gnu-libiconv \
|
||||||
|
gzip \
|
||||||
|
libcrypto1.1 \
|
||||||
|
libcurl \
|
||||||
|
libhdhomerun-libs \
|
||||||
|
libssl1.1 \
|
||||||
|
libva \
|
||||||
|
libva-intel-driver \
|
||||||
|
intel-media-driver \
|
||||||
|
mesa-dri-ati \
|
||||||
|
libvpx \
|
||||||
|
libxml2 \
|
||||||
|
libxslt \
|
||||||
|
linux-headers \
|
||||||
|
openssl \
|
||||||
|
opus \
|
||||||
|
pcre2 \
|
||||||
|
perl \
|
||||||
|
perl-archive-zip \
|
||||||
|
perl-boolean \
|
||||||
|
perl-capture-tiny \
|
||||||
|
perl-cgi \
|
||||||
|
perl-compress-raw-zlib \
|
||||||
|
perl-date-manip \
|
||||||
|
perl-datetime \
|
||||||
|
perl-datetime-format-strptime \
|
||||||
|
perl-datetime-timezone \
|
||||||
|
perl-dbd-sqlite \
|
||||||
|
perl-dbi \
|
||||||
|
perl-digest-sha1 \
|
||||||
|
perl-doc \
|
||||||
|
perl-file-slurp \
|
||||||
|
perl-file-temp \
|
||||||
|
perl-file-which \
|
||||||
|
perl-getopt-long \
|
||||||
|
perl-html-parser \
|
||||||
|
perl-html-tree \
|
||||||
|
perl-http-cookies \
|
||||||
|
perl-io \
|
||||||
|
perl-io-html \
|
||||||
|
perl-io-socket-ssl \
|
||||||
|
perl-io-stringy \
|
||||||
|
perl-json \
|
||||||
|
perl-json-xs \
|
||||||
|
perl-libwww \
|
||||||
|
perl-lingua-en-numbers-ordinate \
|
||||||
|
perl-lingua-preferred \
|
||||||
|
perl-list-moreutils \
|
||||||
|
perl-lwp-useragent-determined \
|
||||||
|
perl-module-build \
|
||||||
|
perl-module-pluggable \
|
||||||
|
perl-net-ssleay \
|
||||||
|
perl-parse-recdescent \
|
||||||
|
perl-path-class \
|
||||||
|
perl-scalar-list-utils \
|
||||||
|
perl-term-progressbar \
|
||||||
|
perl-term-readkey \
|
||||||
|
perl-test-exception \
|
||||||
|
perl-test-requires \
|
||||||
|
perl-timedate \
|
||||||
|
perl-try-tiny \
|
||||||
|
perl-unicode-string \
|
||||||
|
perl-xml-libxml \
|
||||||
|
perl-xml-libxslt \
|
||||||
|
perl-xml-parser \
|
||||||
|
perl-xml-sax \
|
||||||
|
perl-xml-treepp \
|
||||||
|
perl-xml-twig \
|
||||||
|
perl-xml-writer \
|
||||||
|
py3-requests \
|
||||||
|
python3 \
|
||||||
|
tar \
|
||||||
|
uriparser \
|
||||||
|
wget \
|
||||||
|
x264 \
|
||||||
|
x265 \
|
||||||
|
zlib
|
||||||
|
|
||||||
|
# copy local files and buildstage artifacts
|
||||||
|
COPY --from=buildstage /tmp/docker-tvheadend/root/ /
|
||||||
|
COPY --from=buildstage /tmp/libdvbcsa-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /tmp/argtable-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /tmp/comskip-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /tmp/tvheadend-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /tmp/xmltv-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /usr/local/share/man/ /usr/local/share/man/
|
||||||
|
COPY --from=buildstage /usr/local/share/perl5/ /usr/local/share/perl5/
|
||||||
|
COPY --from=piconsstage /picons.tar.bz2 /picons.tar.bz2
|
||||||
|
|
||||||
|
# ports and volumes
|
||||||
|
EXPOSE 9981 9982
|
||||||
|
VOLUME /config
|
||||||
@@ -0,0 +1,360 @@
|
|||||||
|
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15 as buildstage
|
||||||
|
############## build stage ##############
|
||||||
|
|
||||||
|
# package versions
|
||||||
|
ARG ARGTABLE_VER="2.13"
|
||||||
|
ARG XMLTV_VER="v1.0.0"
|
||||||
|
|
||||||
|
# environment settings
|
||||||
|
ARG TZ="Europe/Oslo"
|
||||||
|
ARG TVHEADEND_COMMIT
|
||||||
|
ENV HOME="/config"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install build packages ****" && \
|
||||||
|
apk add --no-cache \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
bsd-compat-headers \
|
||||||
|
bzip2 \
|
||||||
|
cmake \
|
||||||
|
curl \
|
||||||
|
ffmpeg-dev \
|
||||||
|
file \
|
||||||
|
findutils \
|
||||||
|
g++ \
|
||||||
|
gcc \
|
||||||
|
gettext-dev \
|
||||||
|
git \
|
||||||
|
gnu-libiconv-dev \
|
||||||
|
gzip \
|
||||||
|
jq \
|
||||||
|
libcurl \
|
||||||
|
libgcrypt-dev \
|
||||||
|
libhdhomerun-dev \
|
||||||
|
libtool \
|
||||||
|
libvpx-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libxslt-dev \
|
||||||
|
linux-headers \
|
||||||
|
make \
|
||||||
|
openssl-dev \
|
||||||
|
opus-dev \
|
||||||
|
patch \
|
||||||
|
pcre2-dev \
|
||||||
|
perl-archive-zip \
|
||||||
|
perl-boolean \
|
||||||
|
perl-capture-tiny \
|
||||||
|
perl-cgi \
|
||||||
|
perl-compress-raw-zlib \
|
||||||
|
perl-date-manip \
|
||||||
|
perl-datetime \
|
||||||
|
perl-datetime-format-strptime \
|
||||||
|
perl-datetime-timezone \
|
||||||
|
perl-dbd-sqlite \
|
||||||
|
perl-dbi \
|
||||||
|
perl-dev \
|
||||||
|
perl-digest-sha1 \
|
||||||
|
perl-doc \
|
||||||
|
perl-file-slurp \
|
||||||
|
perl-file-temp \
|
||||||
|
perl-file-which \
|
||||||
|
perl-getopt-long \
|
||||||
|
perl-html-parser \
|
||||||
|
perl-html-tree \
|
||||||
|
perl-http-cookies \
|
||||||
|
perl-io \
|
||||||
|
perl-io-html \
|
||||||
|
perl-io-socket-ssl \
|
||||||
|
perl-io-stringy \
|
||||||
|
perl-json \
|
||||||
|
perl-json-xs \
|
||||||
|
perl-libwww \
|
||||||
|
perl-lingua-en-numbers-ordinate \
|
||||||
|
perl-lingua-preferred \
|
||||||
|
perl-list-moreutils \
|
||||||
|
perl-lwp-useragent-determined \
|
||||||
|
perl-module-build \
|
||||||
|
perl-module-pluggable \
|
||||||
|
perl-net-ssleay \
|
||||||
|
perl-parse-recdescent \
|
||||||
|
perl-path-class \
|
||||||
|
perl-scalar-list-utils \
|
||||||
|
perl-term-progressbar \
|
||||||
|
perl-term-readkey \
|
||||||
|
perl-test-exception \
|
||||||
|
perl-test-requires \
|
||||||
|
perl-timedate \
|
||||||
|
perl-try-tiny \
|
||||||
|
perl-unicode-string \
|
||||||
|
perl-xml-libxml \
|
||||||
|
perl-xml-libxslt \
|
||||||
|
perl-xml-parser \
|
||||||
|
perl-xml-sax \
|
||||||
|
perl-xml-treepp \
|
||||||
|
perl-xml-twig \
|
||||||
|
perl-xml-writer \
|
||||||
|
pkgconf \
|
||||||
|
pngquant \
|
||||||
|
python3 \
|
||||||
|
sdl-dev \
|
||||||
|
tar \
|
||||||
|
uriparser-dev \
|
||||||
|
wget \
|
||||||
|
x264-dev \
|
||||||
|
x265-dev \
|
||||||
|
zlib-dev
|
||||||
|
|
||||||
|
#Download linuxserver/tvheadend git
|
||||||
|
RUN \
|
||||||
|
echo "**** download linuxserver/docker-tvheadend ****" && \
|
||||||
|
git clone https://github.com/linuxserver/docker-tvheadend.git /tmp/docker-tvheadend
|
||||||
|
|
||||||
|
# copy patches
|
||||||
|
COPY patches/ /tmp/patches/
|
||||||
|
RUN \
|
||||||
|
echo "**** move patches ****" && \
|
||||||
|
mv /tmp/docker-tvheadend/patches/* /tmp/patches/
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** remove musl iconv.h and replace with gnu-iconv.h ****" && \
|
||||||
|
rm -rf /usr/include/iconv.h && \
|
||||||
|
cp /usr/include/gnu-libiconv/iconv.h /usr/include/iconv.h
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install perl modules for xmltv ****" && \
|
||||||
|
curl -L https://cpanmin.us | perl - App::cpanminus && \
|
||||||
|
cpanm --installdeps /tmp/patches
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** compile XMLTV ****" && \
|
||||||
|
git clone https://github.com/XMLTV/xmltv.git /tmp/xmltv && \
|
||||||
|
cd /tmp/xmltv && \
|
||||||
|
git checkout ${XMLTV_VER} && \
|
||||||
|
echo "**** Perl 5.26 fixes for XMTLV ****" && \
|
||||||
|
sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_latex && \
|
||||||
|
sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_text && \
|
||||||
|
sed "s/\(lib\/set_share_dir.pl';\)/.\/\1/" -i grab/it/tv_grab_it.PL && \
|
||||||
|
sed "s/\(filter\/Grep.pm';\)/.\/\1/" -i filter/tv_grep.PL && \
|
||||||
|
sed "s/\(lib\/XMLTV.pm.in';\)/.\/\1/" -i lib/XMLTV.pm.PL && \
|
||||||
|
sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL && \
|
||||||
|
PERL5LIB=`pwd` && \
|
||||||
|
echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make test && \
|
||||||
|
make DESTDIR=/tmp/xmltv-build install
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** build libdvbcsa ****" && \
|
||||||
|
git clone https://github.com/glenvt18/libdvbcsa.git /tmp/libdvbcsa && \
|
||||||
|
cd /tmp/libdvbcsa && \
|
||||||
|
git apply /tmp/patches/libdvbcsa.patch && \
|
||||||
|
./bootstrap && \
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--sysconfdir=/etc \
|
||||||
|
--mandir=/usr/share/man \
|
||||||
|
--infodir=/usr/share/info \
|
||||||
|
--localstatedir=/var && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make check && \
|
||||||
|
make DESTDIR=/tmp/libdvbcsa-build install && \
|
||||||
|
echo "**** copy to /usr for tvheadend dependency ****" && \
|
||||||
|
cp -pr /tmp/libdvbcsa-build/usr/* /usr/
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** build tvheadend ****" && \
|
||||||
|
if [ -z ${TVHEADEND_COMMIT+x} ]; then \
|
||||||
|
TVHEADEND_COMMIT=$(curl -sX GET https://api.github.com/repos/tvheadend/tvheadend/commits/master \
|
||||||
|
| jq -r '. | .sha'); \
|
||||||
|
fi && \
|
||||||
|
mkdir -p \
|
||||||
|
/tmp/tvheadend && \
|
||||||
|
git clone https://github.com/tvheadend/tvheadend.git /tmp/tvheadend && \
|
||||||
|
cd /tmp/tvheadend && \
|
||||||
|
git checkout ${TVHEADEND_COMMIT} && \
|
||||||
|
echo "**** patch tvheadend ****" && \
|
||||||
|
git apply /tmp/patches/tvheadend43.patch && \
|
||||||
|
echo "**** configure tvheadend ****" && \
|
||||||
|
./configure \
|
||||||
|
`#Encoding` \
|
||||||
|
--disable-ffmpeg_static \
|
||||||
|
--disable-libfdkaac_static \
|
||||||
|
--disable-libtheora_static \
|
||||||
|
--disable-libopus_static \
|
||||||
|
--disable-libvorbis_static \
|
||||||
|
--disable-libvpx_static \
|
||||||
|
--disable-libx264_static \
|
||||||
|
--disable-libx265_static \
|
||||||
|
--disable-libfdkaac \
|
||||||
|
--enable-libopus \
|
||||||
|
--enable-libvorbis \
|
||||||
|
--enable-libvpx \
|
||||||
|
--enable-libx264 \
|
||||||
|
--enable-libx265 \
|
||||||
|
\
|
||||||
|
`#Options` \
|
||||||
|
--disable-avahi \
|
||||||
|
--disable-dbus_1 \
|
||||||
|
--disable-bintray_cache \
|
||||||
|
--disable-execinfo \
|
||||||
|
--disable-hdhomerun_static \
|
||||||
|
--enable-hdhomerun_client \
|
||||||
|
--enable-libav \
|
||||||
|
--enable-pngquant \
|
||||||
|
--enable-trace \
|
||||||
|
--infodir=/usr/share/info \
|
||||||
|
--localstatedir=/var \
|
||||||
|
--mandir=/usr/share/man \
|
||||||
|
--nowerror \
|
||||||
|
--prefix=/usr \
|
||||||
|
--python=python3 \
|
||||||
|
--sysconfdir=/config && \
|
||||||
|
echo "**** compile tvheadend ****" && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make DESTDIR=/tmp/tvheadend-build install
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** compile argtable2 ****" && \
|
||||||
|
ARGTABLE_VER1="${ARGTABLE_VER//./-}" && \
|
||||||
|
mkdir -p \
|
||||||
|
/tmp/argtable && \
|
||||||
|
curl -o \
|
||||||
|
/tmp/argtable-src.tar.gz -L \
|
||||||
|
"https://sourceforge.net/projects/argtable/files/argtable/argtable-${ARGTABLE_VER}/argtable${ARGTABLE_VER1}.tar.gz" && \
|
||||||
|
tar xf \
|
||||||
|
/tmp/argtable-src.tar.gz -C \
|
||||||
|
/tmp/argtable --strip-components=1 && \
|
||||||
|
cp /tmp/patches/config.* /tmp/argtable && \
|
||||||
|
cd /tmp/argtable && \
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make check && \
|
||||||
|
make DESTDIR=/tmp/argtable-build install && \
|
||||||
|
echo "**** copy to /usr for comskip dependency ****" && \
|
||||||
|
cp -pr /tmp/argtable-build/usr/* /usr/
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "***** compile comskip ****" && \
|
||||||
|
git clone https://github.com/erikkaashoek/Comskip /tmp/comskip && \
|
||||||
|
cd /tmp/comskip && \
|
||||||
|
./autogen.sh && \
|
||||||
|
./configure \
|
||||||
|
--bindir=/usr/bin \
|
||||||
|
--sysconfdir=/config/comskip && \
|
||||||
|
make -j$(nproc --ignore=1) && \
|
||||||
|
make DESTDIR=/tmp/comskip-build install
|
||||||
|
|
||||||
|
############## picons stage ##############
|
||||||
|
# built by https://github.com/linuxserver/picons-builder
|
||||||
|
FROM ghcr.io/linuxserver/picons-builder as piconsstage
|
||||||
|
|
||||||
|
|
||||||
|
############## runtime stage ##############
|
||||||
|
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.15
|
||||||
|
|
||||||
|
# set version label
|
||||||
|
ARG BUILD_DATE
|
||||||
|
ARG VERSION
|
||||||
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
|
LABEL maintainer="saarg"
|
||||||
|
|
||||||
|
# environment settings
|
||||||
|
ENV HOME="/config"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install runtime packages ****" && \
|
||||||
|
apk add --no-cache \
|
||||||
|
bsd-compat-headers \
|
||||||
|
bzip2 \
|
||||||
|
curl \
|
||||||
|
ffmpeg \
|
||||||
|
ffmpeg-libs \
|
||||||
|
gnu-libiconv \
|
||||||
|
gzip \
|
||||||
|
libcrypto1.1 \
|
||||||
|
libcurl \
|
||||||
|
libhdhomerun-libs \
|
||||||
|
libssl1.1 \
|
||||||
|
libvpx \
|
||||||
|
libxml2 \
|
||||||
|
libxslt \
|
||||||
|
linux-headers \
|
||||||
|
openssl \
|
||||||
|
opus \
|
||||||
|
pcre2 \
|
||||||
|
perl \
|
||||||
|
perl-archive-zip \
|
||||||
|
perl-boolean \
|
||||||
|
perl-capture-tiny \
|
||||||
|
perl-cgi \
|
||||||
|
perl-compress-raw-zlib \
|
||||||
|
perl-date-manip \
|
||||||
|
perl-datetime \
|
||||||
|
perl-datetime-format-strptime \
|
||||||
|
perl-datetime-timezone \
|
||||||
|
perl-dbd-sqlite \
|
||||||
|
perl-dbi \
|
||||||
|
perl-digest-sha1 \
|
||||||
|
perl-doc \
|
||||||
|
perl-file-slurp \
|
||||||
|
perl-file-temp \
|
||||||
|
perl-file-which \
|
||||||
|
perl-getopt-long \
|
||||||
|
perl-html-parser \
|
||||||
|
perl-html-tree \
|
||||||
|
perl-http-cookies \
|
||||||
|
perl-io \
|
||||||
|
perl-io-html \
|
||||||
|
perl-io-socket-ssl \
|
||||||
|
perl-io-stringy \
|
||||||
|
perl-json \
|
||||||
|
perl-json-xs \
|
||||||
|
perl-libwww \
|
||||||
|
perl-lingua-en-numbers-ordinate \
|
||||||
|
perl-lingua-preferred \
|
||||||
|
perl-list-moreutils \
|
||||||
|
perl-lwp-useragent-determined \
|
||||||
|
perl-module-build \
|
||||||
|
perl-module-pluggable \
|
||||||
|
perl-net-ssleay \
|
||||||
|
perl-parse-recdescent \
|
||||||
|
perl-path-class \
|
||||||
|
perl-scalar-list-utils \
|
||||||
|
perl-term-progressbar \
|
||||||
|
perl-term-readkey \
|
||||||
|
perl-test-exception \
|
||||||
|
perl-test-requires \
|
||||||
|
perl-timedate \
|
||||||
|
perl-try-tiny \
|
||||||
|
perl-unicode-string \
|
||||||
|
perl-xml-libxml \
|
||||||
|
perl-xml-libxslt \
|
||||||
|
perl-xml-parser \
|
||||||
|
perl-xml-sax \
|
||||||
|
perl-xml-treepp \
|
||||||
|
perl-xml-twig \
|
||||||
|
perl-xml-writer \
|
||||||
|
py3-requests \
|
||||||
|
python3 \
|
||||||
|
tar \
|
||||||
|
uriparser \
|
||||||
|
wget \
|
||||||
|
x264 \
|
||||||
|
x265 \
|
||||||
|
zlib
|
||||||
|
|
||||||
|
# copy local files and buildstage artifacts
|
||||||
|
COPY --from=buildstage /tmp/docker-tvheadend/root/ /
|
||||||
|
COPY --from=buildstage /tmp/argtable-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /tmp/comskip-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /tmp/tvheadend-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /tmp/xmltv-build/usr/ /usr/
|
||||||
|
COPY --from=buildstage /usr/local/share/man/ /usr/local/share/man/
|
||||||
|
COPY --from=buildstage /usr/local/share/perl5/ /usr/local/share/perl5/
|
||||||
|
COPY --from=piconsstage /picons.tar.bz2 /picons.tar.bz2
|
||||||
|
|
||||||
|
# ports and volumes
|
||||||
|
EXPOSE 9981 9982
|
||||||
|
VOLUME /config
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
This Repo contains the patched Tvheadend version to enable descrambling of icam **without** the patched oscam version.
|
||||||
|
|
||||||
|
It is recommended to not use the patched oscam binary with this version of tvheadend.
|
||||||
|
|
||||||
|
The Docker images are based on [linuxserver/tvheadend](https://github.com/linuxserver/docker-tvheadend)
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
diff --git a/src/dvbcsa/dvbcsa.h b/src/dvbcsa/dvbcsa.h
|
||||||
|
index c7e9c59..b63fb7d 100644
|
||||||
|
--- a/src/dvbcsa/dvbcsa.h
|
||||||
|
+++ b/src/dvbcsa/dvbcsa.h
|
||||||
|
@@ -93,6 +93,8 @@ void dvbcsa_bs_key_free(struct dvbcsa_bs_key_s *key);
|
||||||
|
|
||||||
|
void dvbcsa_bs_key_set(const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key);
|
||||||
|
|
||||||
|
+void dvbcsa_bs_key_set_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key);
|
||||||
|
+
|
||||||
|
/** get maximum number of packet per batch */
|
||||||
|
|
||||||
|
unsigned int dvbcsa_bs_batch_size(void);
|
||||||
|
diff --git a/src/dvbcsa_bs_key.c b/src/dvbcsa_bs_key.c
|
||||||
|
index e2fcf55..d703325 100644
|
||||||
|
--- a/src/dvbcsa_bs_key.c
|
||||||
|
+++ b/src/dvbcsa_bs_key.c
|
||||||
|
@@ -63,3 +63,39 @@ dvbcsa_bs_key_set (const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+dvbcsa_bs_key_set_ecm (const unsigned char ecm, const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key)
|
||||||
|
+{
|
||||||
|
+ dvbcsa_keys_t kk;
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ /* precalculations for stream */
|
||||||
|
+
|
||||||
|
+ uint64_t ck = dvbcsa_load_le64(cw);
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < DVBCSA_CWBITS_SIZE; i++)
|
||||||
|
+ key->stream[i] = (ck >> (i^4)) & 1 ? BS_VAL8(ff) : BS_VAL8(00);
|
||||||
|
+
|
||||||
|
+ /* precalculations for block */
|
||||||
|
+
|
||||||
|
+ dvbcsa_key_schedule_block_ecm(ecm, cw, kk);
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < DVBCSA_KEYSBUFF_SIZE; i++)
|
||||||
|
+ {
|
||||||
|
+#if BS_BATCH_SIZE == 32
|
||||||
|
+ *(dvbcsa_u32_aliasing_t *)(key->block + i) = kk[i] * 0x01010101;
|
||||||
|
+
|
||||||
|
+#elif BS_BATCH_SIZE == 64
|
||||||
|
+ *(dvbcsa_u64_aliasing_t *)(key->block + i) = kk[i] * 0x0101010101010101ULL;
|
||||||
|
+
|
||||||
|
+#elif BS_BATCH_SIZE > 64 && BS_BATCH_SIZE % 64 == 0
|
||||||
|
+ uint64_t v = kk[i] * 0x0101010101010101ULL;
|
||||||
|
+ int j;
|
||||||
|
+
|
||||||
|
+ for (j = 0; j < BS_BATCH_BYTES / 8; j++)
|
||||||
|
+ *((dvbcsa_u64_aliasing_t *)(key->block + i) + j) = v;
|
||||||
|
+#else
|
||||||
|
+# error
|
||||||
|
+#endif
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
diff --git a/src/dvbcsa_key.c b/src/dvbcsa_key.c
|
||||||
|
index 1ff17e0..bd2a2c1 100644
|
||||||
|
--- a/src/dvbcsa_key.c
|
||||||
|
+++ b/src/dvbcsa_key.c
|
||||||
|
@@ -585,3 +585,18 @@ dvbcsa_key_schedule_block(const dvbcsa_cw_t cw, uint8_t * kk)
|
||||||
|
kk[i*8+j] = (k[i]>>(j*8)) ^ i;
|
||||||
|
}
|
||||||
|
|
||||||
|
+void
|
||||||
|
+dvbcsa_key_schedule_block_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, uint8_t * kk)
|
||||||
|
+{
|
||||||
|
+ uint64_t k[7];
|
||||||
|
+ int i, j;
|
||||||
|
+
|
||||||
|
+ k[6] = dvbcsa_load_le64_ecm(ecm, cw);
|
||||||
|
+ for (i = 6; i > 0; i--)
|
||||||
|
+ k[i - 1] = dvbcsa_key_permute_block(k[i]);
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < 7; i++)
|
||||||
|
+ for (j = 0; j < 8; j++)
|
||||||
|
+ kk[i*8+j] = (k[i]>>(j*8)) ^ i;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
diff --git a/src/dvbcsa_pv.h b/src/dvbcsa_pv.h
|
||||||
|
index 83753b1..e59a70d 100644
|
||||||
|
--- a/src/dvbcsa_pv.h
|
||||||
|
+++ b/src/dvbcsa_pv.h
|
||||||
|
@@ -88,6 +88,26 @@ struct dvbcsa_key_s
|
||||||
|
|
||||||
|
extern const uint8_t dvbcsa_block_sbox[256];
|
||||||
|
|
||||||
|
+static const uint8_t csa_block_perm_ecm[256] =
|
||||||
|
+ {
|
||||||
|
+ 0x00,0x02,0x80,0x82,0x20,0x22,0xa0,0xa2, 0x04,0x06,0x84,0x86,0x24,0x26,0xa4,0xa6,
|
||||||
|
+ 0x40,0x42,0xc0,0xc2,0x60,0x62,0xe0,0xe2, 0x44,0x46,0xc4,0xc6,0x64,0x66,0xe4,0xe6,
|
||||||
|
+ 0x01,0x03,0x81,0x83,0x21,0x23,0xa1,0xa3, 0x05,0x07,0x85,0x87,0x25,0x27,0xa5,0xa7,
|
||||||
|
+ 0x41,0x43,0xc1,0xc3,0x61,0x63,0xe1,0xe3, 0x45,0x47,0xc5,0xc7,0x65,0x67,0xe5,0xe7,
|
||||||
|
+ 0x08,0x0a,0x88,0x8a,0x28,0x2a,0xa8,0xaa, 0x0c,0x0e,0x8c,0x8e,0x2c,0x2e,0xac,0xae,
|
||||||
|
+ 0x48,0x4a,0xc8,0xca,0x68,0x6a,0xe8,0xea, 0x4c,0x4e,0xcc,0xce,0x6c,0x6e,0xec,0xee,
|
||||||
|
+ 0x09,0x0b,0x89,0x8b,0x29,0x2b,0xa9,0xab, 0x0d,0x0f,0x8d,0x8f,0x2d,0x2f,0xad,0xaf,
|
||||||
|
+ 0x49,0x4b,0xc9,0xcb,0x69,0x6b,0xe9,0xeb, 0x4d,0x4f,0xcd,0xcf,0x6d,0x6f,0xed,0xef,
|
||||||
|
+ 0x10,0x12,0x90,0x92,0x30,0x32,0xb0,0xb2, 0x14,0x16,0x94,0x96,0x34,0x36,0xb4,0xb6,
|
||||||
|
+ 0x50,0x52,0xd0,0xd2,0x70,0x72,0xf0,0xf2, 0x54,0x56,0xd4,0xd6,0x74,0x76,0xf4,0xf6,
|
||||||
|
+ 0x11,0x13,0x91,0x93,0x31,0x33,0xb1,0xb3, 0x15,0x17,0x95,0x97,0x35,0x37,0xb5,0xb7,
|
||||||
|
+ 0x51,0x53,0xd1,0xd3,0x71,0x73,0xf1,0xf3, 0x55,0x57,0xd5,0xd7,0x75,0x77,0xf5,0xf7,
|
||||||
|
+ 0x18,0x1a,0x98,0x9a,0x38,0x3a,0xb8,0xba, 0x1c,0x1e,0x9c,0x9e,0x3c,0x3e,0xbc,0xbe,
|
||||||
|
+ 0x58,0x5a,0xd8,0xda,0x78,0x7a,0xf8,0xfa, 0x5c,0x5e,0xdc,0xde,0x7c,0x7e,0xfc,0xfe,
|
||||||
|
+ 0x19,0x1b,0x99,0x9b,0x39,0x3b,0xb9,0xbb, 0x1d,0x1f,0x9d,0x9f,0x3d,0x3f,0xbd,0xbf,
|
||||||
|
+ 0x59,0x5b,0xd9,0xdb,0x79,0x7b,0xf9,0xfb, 0x5d,0x5f,0xdd,0xdf,0x7d,0x7f,0xfd,0xff
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
void dvbcsa_block_decrypt (const dvbcsa_keys_t key, const dvbcsa_block_t in, dvbcsa_block_t out);
|
||||||
|
void dvbcsa_block_encrypt (const dvbcsa_keys_t key, const dvbcsa_block_t in, dvbcsa_block_t out);
|
||||||
|
|
||||||
|
@@ -95,6 +115,7 @@ void dvbcsa_stream_xor (const dvbcsa_cw_t cw, const dvbcsa_block_t iv,
|
||||||
|
uint8_t *stream, unsigned int len);
|
||||||
|
|
||||||
|
void dvbcsa_key_schedule_block(const dvbcsa_cw_t cw, uint8_t * kk);
|
||||||
|
+void dvbcsa_key_schedule_block_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, uint8_t * kk);
|
||||||
|
|
||||||
|
DVBCSA_INLINE static inline void
|
||||||
|
dvbcsa_xor_64 (uint8_t *b, const uint8_t *a)
|
||||||
|
@@ -141,6 +162,33 @@ dvbcsa_load_le64(const uint8_t *p)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
+DVBCSA_INLINE static inline uint64_t
|
||||||
|
+dvbcsa_load_le64_ecm(const unsigned char ecm, const uint8_t *p)
|
||||||
|
+{
|
||||||
|
+ dvbcsa_block_t W;
|
||||||
|
+ memcpy(W, p, sizeof(W));
|
||||||
|
+ if (ecm == 4)
|
||||||
|
+ {
|
||||||
|
+ W[0] = csa_block_perm_ecm[p[0]];
|
||||||
|
+ W[4] = csa_block_perm_ecm[p[4]];
|
||||||
|
+ }
|
||||||
|
+#if defined(DVBCSA_ENDIAN_LITTLE)
|
||||||
|
+ uint64_t i;
|
||||||
|
+ memcpy(&i, W, 8);
|
||||||
|
+ return i;
|
||||||
|
+#else
|
||||||
|
+ return (uint64_t)( ((uint64_t)W[7] << 56) |
|
||||||
|
+ ((uint64_t)W[6] << 48) |
|
||||||
|
+ ((uint64_t)W[5] << 40) |
|
||||||
|
+ ((uint64_t)W[4] << 32) |
|
||||||
|
+ ((uint64_t)W[3] << 24) |
|
||||||
|
+ ((uint64_t)W[2] << 16) |
|
||||||
|
+ ((uint64_t)W[1] << 8 ) |
|
||||||
|
+ (uint64_t)W[0]
|
||||||
|
+ );
|
||||||
|
+#endif
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
DVBCSA_INLINE static inline void
|
||||||
|
dvbcsa_store_le64(uint8_t *p, const uint64_t w)
|
||||||
|
{
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
diff --git a/src/descrambler/descrambler.c b/src/descrambler/descrambler.c
|
||||||
|
index 71cc9ebd6..b5c46e329 100644
|
||||||
|
--- a/src/descrambler/descrambler.c
|
||||||
|
+++ b/src/descrambler/descrambler.c
|
||||||
|
@@ -966,12 +966,12 @@ key_flush( th_descrambler_runtime_t *dr, th_descrambler_key_t *tk, uint8_t chang
|
||||||
|
/* update the keys */
|
||||||
|
if (changed & 1) {
|
||||||
|
debug2("%p: even key[%d] set for decoder", dr, tk->key_pid);
|
||||||
|
- tvhcsa_set_key_even(&tk->key_csa, tk->key_data[0]);
|
||||||
|
+ tvhcsa_set_key_even(&tk->key_csa, tk->key_data[0], dr->dr_ecm);
|
||||||
|
tk->key_valid |= 0x40;
|
||||||
|
}
|
||||||
|
if (changed & 2) {
|
||||||
|
debug2("%p: odd key[%d] set for decoder", dr, tk->key_pid);
|
||||||
|
- tvhcsa_set_key_odd(&tk->key_csa, tk->key_data[1]);
|
||||||
|
+ tvhcsa_set_key_odd(&tk->key_csa, tk->key_data[1], dr->dr_ecm);
|
||||||
|
tk->key_valid |= 0x80;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1371,6 +1371,7 @@ descrambler_table_callback
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ dr->dr_ecm = (ptr[2] - ptr[4]) == 4 ? ptr[0x15] : 0;
|
||||||
|
tvhtrace(LS_DESCRAMBLER, "ECM message %02x:%02x (section %d, len %d, pid %d) for service \"%s\"",
|
||||||
|
ptr[0], ptr[1], des->number, len, mt->mt_pid, t->s_dvb_svcname);
|
||||||
|
}
|
||||||
|
diff --git a/src/descrambler/descrambler.h b/src/descrambler/descrambler.h
|
||||||
|
index ac5ff312c..697adfe04 100644
|
||||||
|
--- a/src/descrambler/descrambler.h
|
||||||
|
+++ b/src/descrambler/descrambler.h
|
||||||
|
@@ -103,6 +103,7 @@ typedef struct th_descrambler_runtime {
|
||||||
|
int64_t dr_ecm_start[2];
|
||||||
|
int64_t dr_ecm_last_key_time;
|
||||||
|
int64_t dr_ecm_key_margin;
|
||||||
|
+ uint8_t dr_ecm;
|
||||||
|
int64_t dr_last_err;
|
||||||
|
int64_t dr_force_skip;
|
||||||
|
th_descrambler_key_t dr_keys[DESCRAMBLER_MAX_KEYS];
|
||||||
|
diff --git a/src/descrambler/tvhcsa.c b/src/descrambler/tvhcsa.c
|
||||||
|
index 942ce92b5..664523665 100644
|
||||||
|
--- a/src/descrambler/tvhcsa.c
|
||||||
|
+++ b/src/descrambler/tvhcsa.c
|
||||||
|
@@ -220,12 +220,12 @@ tvhcsa_set_type( tvhcsa_t *csa, struct mpegts_service *s, int type )
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even )
|
||||||
|
+void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even, const uint8_t ecm)
|
||||||
|
{
|
||||||
|
switch (csa->csa_type) {
|
||||||
|
case DESCRAMBLER_CSA_CBC:
|
||||||
|
#if ENABLE_DVBCSA
|
||||||
|
- dvbcsa_bs_key_set(even, csa->csa_key_even);
|
||||||
|
+ dvbcsa_bs_key_set_ecm(ecm, even, csa->csa_key_even);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case DESCRAMBLER_DES_NCB:
|
||||||
|
@@ -241,13 +241,13 @@ void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-void tvhcsa_set_key_odd( tvhcsa_t *csa, const uint8_t *odd )
|
||||||
|
+void tvhcsa_set_key_odd( tvhcsa_t *csa, const uint8_t *odd, const uint8_t ecm )
|
||||||
|
{
|
||||||
|
assert(csa->csa_type);
|
||||||
|
switch (csa->csa_type) {
|
||||||
|
case DESCRAMBLER_CSA_CBC:
|
||||||
|
#if ENABLE_DVBCSA
|
||||||
|
- dvbcsa_bs_key_set(odd, csa->csa_key_odd);
|
||||||
|
+ dvbcsa_bs_key_set_ecm(ecm, odd, csa->csa_key_odd);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case DESCRAMBLER_DES_NCB:
|
||||||
|
diff --git a/src/descrambler/tvhcsa.h b/src/descrambler/tvhcsa.h
|
||||||
|
index 855de5acc..24eb729cb 100644
|
||||||
|
--- a/src/descrambler/tvhcsa.h
|
||||||
|
+++ b/src/descrambler/tvhcsa.h
|
||||||
|
@@ -66,8 +66,8 @@ typedef struct tvhcsa
|
||||||
|
|
||||||
|
int tvhcsa_set_type( tvhcsa_t *csa, struct mpegts_service *s, int type );
|
||||||
|
|
||||||
|
-void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even );
|
||||||
|
-void tvhcsa_set_key_odd ( tvhcsa_t *csa, const uint8_t *odd );
|
||||||
|
+void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even, const uint8_t ecm );
|
||||||
|
+void tvhcsa_set_key_odd ( tvhcsa_t *csa, const uint8_t *odd, const uint8_t ecm );
|
||||||
|
|
||||||
|
void tvhcsa_init ( tvhcsa_t *csa );
|
||||||
|
void tvhcsa_destroy ( tvhcsa_t *csa );
|
||||||
|
@@ -76,8 +76,8 @@ void tvhcsa_destroy ( tvhcsa_t *csa );
|
||||||
|
|
||||||
|
static inline int tvhcsa_set_type( tvhcsa_t *csa, struct mpegts_service *s, int type ) { return -1; }
|
||||||
|
|
||||||
|
-static inline void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even ) { };
|
||||||
|
-static inline void tvhcsa_set_key_odd ( tvhcsa_t *csa, const uint8_t *odd ) { };
|
||||||
|
+static inline void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even, const uint8_t ecm ) { };
|
||||||
|
+static inline void tvhcsa_set_key_odd ( tvhcsa_t *csa, const uint8_t *odd, const uint8_t ecm ) { };
|
||||||
|
|
||||||
|
static inline void tvhcsa_init ( tvhcsa_t *csa ) { };
|
||||||
|
static inline void tvhcsa_destroy ( tvhcsa_t *csa ) { };
|
||||||
Reference in New Issue
Block a user