+++ /dev/null
-From: [CST] Focus <focus.cst@gmail.com>
-Date: Thu, 19 Jan 2015 13:50:45 +0400
-Subject: [PATCH] libdvbsi++: workaround bug in content identifier descriptor processing
-
----
---- libdvbsi++-0.3.6.cst/src/content_identifier_descriptor.cpp 2013-02-20 20:59:19.000000000 +0800
-+++ libdvbsi++-0.3.7/src/content_identifier_descriptor.cpp 2013-09-24 03:10:43.000000000 +0800
-
-@@ -69,6 +69,10 @@
- i += crid->getLength() + 2;
- else if (crid->getLocation() == 1)
- i += 3;
-+ else {
-+ delete crid;
-+ break;
-+ }
-
- identifier.push_back(crid);
- }
+++ /dev/null
-diff --git a/src/descriptor.cpp b/src/descriptor.cpp
-index 8c914a9..beaf4d7 100644
---- a/src/descriptor.cpp
-+++ b/src/descriptor.cpp
-@@ -17,6 +17,9 @@ Descriptor::Descriptor(const uint8_t * const buffer)
- descriptorTag = buffer[0];
- descriptorLength = buffer[1];
-
-+ if (!descriptorLength)
-+ descriptorLength = 1;
-+
- dataBytes.resize(descriptorLength);
- memcpy(&dataBytes[0], &buffer[2], descriptorLength);
-
+++ /dev/null
-diff --git a/include/dvbsi++/byte_stream.h b/include/dvbsi++/byte_stream.h
-index 0387a15..204f9a9 100644
---- a/include/dvbsi++/byte_stream.h
-+++ b/include/dvbsi++/byte_stream.h
-@@ -23,8 +23,14 @@
- #define w32(p,v) do { *(uint32_t * const)(p) = ((const uint32_t)v) } while (0)
- #define w64(p,v) do { *(uint64_t * const)(p) = ((const uint64_t)v) } while (0)
- #else
-+#ifdef __sh__
-+/* SuperH does not like unaligned accesses, so work around that */
-+#define r16(p) ((((uint8_t *)p)[0]) << 8 | (((uint8_t *)p)[1]))
-+#define r32(p) ((((uint8_t *)p)[0]) << 24 | (((uint8_t *)p)[1]) << 16 | (((uint8_t *)p)[2]) << 8 | ((uint8_t *)p)[3])
-+#else
- #define r16(p) bswap_16(*(const uint16_t * const)p)
- #define r32(p) bswap_32(*(const uint32_t * const)p)
-+#endif
- #define r64(p) bswap_64(*(const uint64_t * const)p)
- #define w16(p,v) do { *(uint16_t * const)(p) = bswap_16((const uint16_t)v) } while (0)
- #define w32(p,v) do { *(uint32_t * const)(p) = bswap_32((const uint32_t)v) } while (0)
+++ /dev/null
---- a/src/ac3_descriptor.cpp
-+++ b/src/ac3_descriptor.cpp
-@@ -31,6 +31,16 @@ Ac3Descriptor::Ac3Descriptor(const uint8_t * const buffer) : Descriptor(buffer)
- asvcFlag = (buffer[2] >> 4) & 0x01;
-
- size_t headerLength = 1 + ac3TypeFlag + bsidFlag + mainidFlag + asvcFlag;
-+
-+ // broadcasters got it wrong again...
-+ if (headerLength > descriptorLength) {
-+ ac3TypeFlag = 0;
-+ bsidFlag = 0;
-+ mainidFlag = 0;
-+ asvcFlag = 0;
-+ return;
-+ }
-+
- ASSERT_MIN_DLEN(headerLength);
-
- size_t i = 3;
+++ /dev/null
---- a/include/dvbsi++/network_information_section.h
-+++ b/include/dvbsi++/network_information_section.h
-@@ -37,6 +37,7 @@ typedef TransportStreamInfoList::const_iterator TransportStreamInfoConstIterator
- class NetworkInformationSection : public LongCrcSection, public DescriptorContainer
- {
- protected:
-+ unsigned networkId : 16;
- unsigned networkDescriptorsLength : 12;
- unsigned transportStreamLoopLength : 12;
- TransportStreamInfoList tsInfo;
-@@ -49,6 +50,7 @@ class NetworkInformationSection : public LongCrcSection, public DescriptorContai
- static const enum TableId TID = TID_NIT_ACTUAL;
- static const uint32_t TIMEOUT = 12000;
-
-+ uint16_t getNetworkId(void) const;
- const TransportStreamInfoList *getTsInfo(void) const;
- };
-
---- a/src/network_information_section.cpp
-+++ b/src/network_information_section.cpp
-@@ -35,6 +35,7 @@ uint16_t TransportStreamInfo::getOriginalNetworkId(void) const
-
- NetworkInformationSection::NetworkInformationSection(const uint8_t * const buffer) : LongCrcSection(buffer)
- {
-+ networkId = UINT16(&buffer[3]);
- networkDescriptorsLength = sectionLength > 9 ? DVB_LENGTH(&buffer[8]) : 0;
-
- uint16_t pos = 10;
-@@ -68,6 +69,11 @@ NetworkInformationSection::~NetworkInformationSection(void)
- delete *i;
- }
-
-+uint16_t NetworkInformationSection::getNetworkId(void) const
-+{
-+ return networkId;
-+}
-+
- const TransportStreamInfoList *NetworkInformationSection::getTsInfo(void) const
- {
- return &tsInfo;
+++ /dev/null
->From 47578127ccfed131eb4586ce48a568b7aed0e9b9 Mon Sep 17 00:00:00 2001
-From: [CST] Focus <focus.cst@gmail.com>
-Date: Thu, 1 Mar 2012 13:37:55 +0400
-Subject: [PATCH 1/2] src/time_date_section.cpp: fix sectionLength check
-
----
- src/time_date_section.cpp | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/src/time_date_section.cpp b/src/time_date_section.cpp
-index 63e24dd..f71ff42 100644
---- a/src/time_date_section.cpp
-+++ b/src/time_date_section.cpp
-@@ -15,7 +15,7 @@
-
- TimeAndDateSection::TimeAndDateSection(const uint8_t * const buffer) : ShortSection(buffer)
- {
-- if (sectionLength > 8) {
-+ if (sectionLength >= 5) {
- utcTimeMjd = UINT16(&buffer[3]);
- utcTimeBcd = (buffer[5] << 16) | UINT16(&buffer[6]);
- }
---
-1.7.1
-
$(ARCHIVE)/libbluray-0.5.0.tar.bz2:
$(WGET) https://get.videolan.org/libbluray/0.5.0/libbluray-0.5.0.tar.bz2
-$(ARCHIVE)/libdvbsi++-$(LIBDVBSI_GIT).tar.bz2: | $(HOSTPREFIX)/bin/get-git-archive.sh
- get-git-archive.sh git://git.opendreambox.org/git/obi/libdvbsi++.git $(LIBDVBSI_GIT) $(notdir $@) $(ARCHIVE)
+$(ARCHIVE)/libdvbsi++-$(LIBDVBSI_VERSION).tar.bz2:
+ $(WGET) https://github.com/mtdcr/libdvbsi/releases/download/$(LIBDVBSI_VERSION)/libdvbsi++-$(LIBDVBSI_VERSION).tar.bz2
$(ARCHIVE)/lcd4linux-git-$(LCD4LINUX_VER).tar.bz2: | $(HOSTPREFIX)/bin/get-git-archive.sh
get-git-archive.sh https://github.com/TangoCash/lcd4linux.git $(LCD4LINUX_VER) $(notdir $@) $(ARCHIVE)
ifeq ($(BOXSERIES), hd2)
DVBSI_CPPFLAG = "-D_GLIBCXX_USE_CXX11_ABI=0"
endif
-$(D)/libdvbsi++: $(ARCHIVE)/libdvbsi++-$(LIBDVBSI_GIT).tar.bz2 | $(TARGETPREFIX)
+LIBDVBSI_PATCH = libdvbsi/libdvbsi++-content_identifier_descriptor.patch
+
+$(D)/libdvbsi++: $(ARCHIVE)/libdvbsi++-$(LIBDVBSI_VERSION).tar.bz2 | $(TARGETPREFIX)
$(START_BUILD)
- $(UNTAR)/libdvbsi++-$(LIBDVBSI_GIT).tar.bz2
- pushd $(BUILD_TMP)/libdvbsi++-$(LIBDVBSI_GIT); \
- $(PATCH)/libdvbsi++-src-time_date_section.cpp-fix-sectionLength-check.patch; \
- $(PATCH)/libdvbsi++-fix-unaligned-access-on-SuperH.patch; \
- $(PATCH)/libdvbsi++-content_identifier_descriptor.patch; \
- $(PATCH)/libdvbsi++-fix_network_id.patch; \
- $(PATCH)/libdvbsi++-fix_ac3_descriptor.patch; \
- $(PATCH)/libdvbsi++-fix-descriptorLenghth.patch; \
+ $(REMOVE)/libdvbsi++-$(LIBDVBSI_VERSION)
+ $(UNTAR)/libdvbsi++-$(LIBDVBSI_VERSION).tar.bz2
+ pushd $(BUILD_TMP)/libdvbsi++-$(LIBDVBSI_VERSION); \
+ $(call apply_patches, $(LIBDVBSI_PATCH)); \
$(CONFIGURE) CPPFLAGS=$(DVBSI_CPPFLAG) \
--prefix=$(TARGETPREFIX) \
--build=$(BUILD) \
$(MAKE); \
$(MAKE) install
$(REWRITE_PKGCONF) $(PKG_CONFIG_PATH)/libdvbsi++.pc
- $(REMOVE)/libdvbsi++-$(LIBDVBSI_GIT)
- $(TOUCH)
+# $(REMOVE)/libdvbsi++-$(LIBDVBSI_VERSION)
+# $(TOUCH)
$(D)/libsigc: $(ARCHIVE)/libsigc++-$(LIBSIGC_VER).tar.xz | $(TARGETPREFIX)
$(START_BUILD)
LIBASS_VER=0.14.0
# libdvbsi++; libdvbsi++ is a open source C++ library for parsing DVB Service Information and MPEG-2 Program Specific Information.
-LIBDVBSI_GIT=64efce6
+LIBDVBSI_VERSION = 0.3.9
# The library libdvdread provides simple basic functions for accessing a video DVD
LIBDVDREAD_VER = 4.9.9