From 7630f579e18cc122fabdcca3a7c113c8dcbd7632 Mon Sep 17 00:00:00 2001
From: Klaus Schmidinger <vdr@tvdr.de>
Date: Tue, 23 Jun 2020 09:27:09 +0200
Subject: Added support for HEVC-video and AC-4-audio

---
 CONTRIBUTORS       | 1 +
 HISTORY            | 1 +
 eit.c              | 8 ++++++--
 libsi/descriptor.c | 6 +++++-
 libsi/descriptor.h | 3 ++-
 libsi/headers.h    | 6 +++---
 6 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 563650c1..90e47c49 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2440,6 +2440,7 @@ Christoph Haubrich <christoph1.haubrich@arcor.de>
  "Edit recording" menu
  for suggesting to add a confirmation before renaming a recording to its folder name
  for reporting a problem with data loss in case renaming a recording fails
+ for adding support for HEVC-video and AC-4-audio
 
 Pekka Mauno <pekka.mauno@iki.fi>
  for fixing cSchedule::GetFollowingEvent() in case there is currently no present
diff --git a/HISTORY b/HISTORY
index 67c130e0..6f88350a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9484,3 +9484,4 @@ Video Disk Recorder Revision History
   replacing every occurrence of 'pkg-config' with '$(PKG_CONFIG)', as can be seen in
   the Makefiles of the plugins that come with the VDR source.
 - Fixed a typo in svdrp.c (thanks to Tobias Grimm).
+- Added support for HEVC-video and AC-4-audio (thanks to Christoph Haubrich).
diff --git a/eit.c b/eit.c
index ffdec419..38662a56 100644
--- a/eit.c
+++ b/eit.c
@@ -8,7 +8,7 @@
  * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
  * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
  *
- * $Id: eit.c 4.9 2020/05/04 13:02:14 kls Exp $
+ * $Id: eit.c 4.10 2020/06/23 09:27:09 kls Exp $
  */
 
 #include "eit.h"
@@ -302,11 +302,15 @@ cEIT::cEIT(cSectionSyncerHash &SectionSyncerHash, int Source, u_char Tid, const
             case SI::ComponentDescriptorTag: {
                  SI::ComponentDescriptor *cd = (SI::ComponentDescriptor *)d;
                  uchar Stream = cd->getStreamContent();
+                 uchar Ext = cd->getStreamContentExt();
                  uchar Type = cd->getComponentType();
-                 if (1 <= Stream && Stream <= 6 && Type != 0) { // 1=MPEG2-video, 2=MPEG1-audio, 3=subtitles, 4=AC3-audio, 5=H.264-video, 6=HEAAC-audio
+                 if ((1 <= Stream && Stream <= 6 && Type != 0) // 1=MPEG2-video, 2=MPEG1-audio, 3=subtitles, 4=AC3-audio, 5=H.264-video, 6=HEAAC-audio
+                    || (Stream == 9 && Ext < 2)) {             // 0x09=HEVC-video, 0x19=AC-4-audio
                     if (!Components)
                        Components = new cComponents;
                     char buffer[Utf8BufSize(256)];
+                    if (Stream == 9)
+                       Stream |= Ext << 4;
                     Components->SetComponent(Components->NumComponents(), Stream, Type, I18nNormalizeLanguageCode(cd->languageCode), cd->description.getText(buffer, sizeof(buffer)));
                     }
                  }
diff --git a/libsi/descriptor.c b/libsi/descriptor.c
index a94c0035..9e2b39ce 100644
--- a/libsi/descriptor.c
+++ b/libsi/descriptor.c
@@ -6,7 +6,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   $Id: descriptor.c 4.2 2020/05/14 21:21:03 kls Exp $
+ *   $Id: descriptor.c 4.3 2020/06/23 09:27:09 kls Exp $
  *                                                                         *
  ***************************************************************************/
 
@@ -567,6 +567,10 @@ int ComponentDescriptor::getStreamContent() const {
    return s->stream_content;
 }
 
+int ComponentDescriptor::getStreamContentExt() const {
+   return s->stream_content_ext;
+}
+
 int ComponentDescriptor::getComponentType() const {
    return s->component_type;
 }
diff --git a/libsi/descriptor.h b/libsi/descriptor.h
index 3c8b0f90..218609e3 100644
--- a/libsi/descriptor.h
+++ b/libsi/descriptor.h
@@ -6,7 +6,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   $Id: descriptor.h 4.1 2019/03/15 16:12:09 kls Exp $
+ *   $Id: descriptor.h 4.2 2020/06/23 09:27:09 kls Exp $
  *                                                                         *
  ***************************************************************************/
 
@@ -295,6 +295,7 @@ private:
 class ComponentDescriptor : public Descriptor {
 public:
    int getStreamContent() const;
+   int getStreamContentExt() const;
    int getComponentType() const;
    int getComponentTag() const;
    char languageCode[4];
diff --git a/libsi/headers.h b/libsi/headers.h
index ff5bb5da..fa26eea3 100644
--- a/libsi/headers.h
+++ b/libsi/headers.h
@@ -10,7 +10,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   $Id: headers.h 3.1 2013/10/30 10:16:18 kls Exp $
+ *   $Id: headers.h 4.1 2020/06/23 09:27:09 kls Exp $
  *                                                                         *
  ***************************************************************************/
 
@@ -1176,11 +1176,11 @@ struct descr_component {
    u_char descriptor_tag                         :8;
    u_char descriptor_length                      :8;
 #if BYTE_ORDER == BIG_ENDIAN
-   u_char reserved                               :4;
+   u_char stream_content_ext                     :4;
    u_char stream_content                         :4;
 #else
    u_char stream_content                         :4;
-   u_char reserved                               :4;
+   u_char stream_content_ext                     :4;
 #endif
    u_char component_type                         :8;
    u_char component_tag                          :8;
-- 
cgit v1.2.3