]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Parse the audio_type field of the iso639_language_descriptor - this indicates if...
authorDave Chapman <dave@dchapman.com>
Mon, 13 May 2013 08:27:01 +0000 (09:27 +0100)
committerDave Chapman <dave@dchapman.com>
Mon, 13 May 2013 08:27:01 +0000 (09:27 +0100)
src/htsp_server.c
src/psi.c
src/service.c
src/service.h
src/streaming.h

index 2a670a6950db88de7c493d82d36b739fe4d1dde2..eeb15ace46d9ed14b57477cff62530c79af2b9fe 100644 (file)
@@ -2421,6 +2421,7 @@ htsp_subscription_start(htsp_subscription_t *hs, const streaming_start_t *ss)
 
     if (SCT_ISAUDIO(ssc->ssc_type))
     {
+      htsmsg_add_u32(c, "audio_type", ssc->ssc_audio_type);
       if (ssc->ssc_channels)
         htsmsg_add_u32(c, "channels", ssc->ssc_channels);
       if (ssc->ssc_sri)
index d86519c89895ccfa582c7b5d0f04b25ab123b5e1..dc8ec97901587bba03a13df2933e3eacecec7b3e 100644 (file)
--- a/src/psi.c
+++ b/src/psi.c
@@ -172,16 +172,17 @@ psi_build_pat(service_t *t, uint8_t *buf, int maxlen, int pmtpid)
 #define PMT_UPDATE_PCR                0x1
 #define PMT_UPDATE_NEW_STREAM         0x2
 #define PMT_UPDATE_LANGUAGE           0x4
-#define PMT_UPDATE_FRAME_DURATION     0x8
-#define PMT_UPDATE_COMPOSITION_ID     0x10
-#define PMT_UPDATE_ANCILLARY_ID       0x20
-#define PMT_UPDATE_STREAM_DELETED     0x40
-#define PMT_UPDATE_NEW_CA_STREAM      0x80
-#define PMT_UPDATE_NEW_CAID           0x100
-#define PMT_UPDATE_CA_PROVIDER_CHANGE 0x200
-#define PMT_UPDATE_PARENT_PID         0x400
-#define PMT_UPDATE_CAID_DELETED       0x800
-#define PMT_REORDERED                 0x1000
+#define PMT_UPDATE_AUDIO_TYPE         0x8
+#define PMT_UPDATE_FRAME_DURATION     0x10
+#define PMT_UPDATE_COMPOSITION_ID     0x20
+#define PMT_UPDATE_ANCILLARY_ID       0x40
+#define PMT_UPDATE_STREAM_DELETED     0x80
+#define PMT_UPDATE_NEW_CA_STREAM      0x100
+#define PMT_UPDATE_NEW_CAID           0x200
+#define PMT_UPDATE_CA_PROVIDER_CHANGE 0x400
+#define PMT_UPDATE_PARENT_PID         0x800
+#define PMT_UPDATE_CAID_DELETED       0x1000
+#define PMT_REORDERED                 0x2000
 
 /**
  * Add a CA descriptor
@@ -397,6 +398,7 @@ psi_parse_pmt(service_t *t, const uint8_t *ptr, int len, int chksvcid,
   int position = 0;
   int tt_position = 1000;
   const char *lang = NULL;
+  uint8_t audio_type = 0;
 
   caid_t *c, *cn;
 
@@ -529,6 +531,7 @@ psi_parse_pmt(service_t *t, const uint8_t *ptr, int len, int chksvcid,
 
       case DVB_DESC_LANGUAGE:
         lang = lang_code_get2((const char*)ptr, 3);
+        audio_type = ptr[3];
              break;
 
       case DVB_DESC_TELETEXT:
@@ -601,6 +604,11 @@ psi_parse_pmt(service_t *t, const uint8_t *ptr, int len, int chksvcid,
         memcpy(st->es_lang, lang, 4);
       }
 
+      if(st->es_audio_type != audio_type) {
+        update |= PMT_UPDATE_AUDIO_TYPE;
+        st->es_audio_type = audio_type;
+      }
+
       if(composition_id != -1 && st->es_composition_id != composition_id) {
        st->es_composition_id = composition_id;
        update |= PMT_UPDATE_COMPOSITION_ID;
@@ -756,7 +764,7 @@ psi_build_pmt(const streaming_start_t *ss, uint8_t *buf0, int maxlen,
       buf[0] = DVB_DESC_LANGUAGE;
       buf[1] = 4;
       memcpy(&buf[2],ssc->ssc_lang,3);
-      buf[5] = 0; /* Main audio */
+      buf[5] = ssc->ssc_audio_type;
       dlen = 6;
       break;
     case SCT_DVBSUB:
index 7851f5c27c95d3c4d56f18fab78aa9b7cce78cc8..c6666b5f67c383caae26d438a2b54b271e7c6fb0 100644 (file)
@@ -908,6 +908,7 @@ service_build_stream_start(service_t *t)
     ssc->ssc_type  = st->es_type;
 
     memcpy(ssc->ssc_lang, st->es_lang, 4);
+    ssc->ssc_audio_type = st->es_audio_type;
     ssc->ssc_composition_id = st->es_composition_id;
     ssc->ssc_ancillary_id = st->es_ancillary_id;
     ssc->ssc_pid = st->es_pid;
index d2f8b03bef12eeda90ca7c9fee42bec877c8ddef..8b96156ea26a37991e5ef815eed31abdd8346353 100644 (file)
@@ -82,6 +82,8 @@ typedef struct elementary_stream {
   uint16_t es_aspect_den;
 
   char es_lang[4];           /* ISO 639 2B 3-letter language code */
+  uint8_t es_audio_type;     /* Audio type */
+
   uint16_t es_composition_id;
   uint16_t es_ancillary_id;
 
index 75dc7857a71800c7de419147a79846415d513584..855be2862a4cf289fef6590bd7b685f60dd19fcb 100644 (file)
@@ -27,6 +27,7 @@ typedef struct streaming_start_component {
   int ssc_index;
   int ssc_type;
   char ssc_lang[4];
+  uint8_t ssc_audio_type;
   uint16_t ssc_composition_id;
   uint16_t ssc_ancillary_id;
   uint16_t ssc_pid;