Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mpegts: add the AC-3 PMT 0x06 switch to the mux config
  • Loading branch information
perexg committed Sep 9, 2014
1 parent bc021ad commit 3240a8e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/html/config_muxes.html
Expand Up @@ -45,6 +45,11 @@

<dt>Character Set
<dd>The character encoding for this mux (e.g. UTF-8).

<dt>PMT Descriptor 0x06 = AC-3
<dd>Whether or not the empty PMT descriptor 0x06 defaults to
the AC-3 stream. Some Chinese cable providers are using
this. If unsure, keep this off.

<dt>Interface
<dd>IPTV : the network interface/card on which the IPTV source can be found.
Expand Down
1 change: 1 addition & 0 deletions src/input/mpegts.h
Expand Up @@ -411,6 +411,7 @@ struct mpegts_mux
int mm_enabled;
int mm_epg;
char *mm_charset;
int mm_pmt_06_ac3;
};

/* Service */
Expand Down
8 changes: 4 additions & 4 deletions src/input/mpegts/dvb_psi.c
Expand Up @@ -34,7 +34,7 @@
SKEL_DECLARE(mpegts_table_state_skel, struct mpegts_table_state);

static int
psi_parse_pmt(mpegts_service_t *t, const uint8_t *ptr, int len);
psi_parse_pmt(mpegts_mux_t *mux, mpegts_service_t *t, const uint8_t *ptr, int len);

/* **************************************************************************
* Lookup tables
Expand Down Expand Up @@ -695,7 +695,7 @@ dvb_pmt_callback
tvhdebug("pmt", "sid %04X (%d)", sid, sid);
pthread_mutex_lock(&s->s_stream_mutex);
had_components = !!TAILQ_FIRST(&s->s_components);
r = psi_parse_pmt(s, ptr, len);
r = psi_parse_pmt(mt->mt_mux, s, ptr, len);
pthread_mutex_unlock(&s->s_stream_mutex);
if (r)
service_restart((service_t*)s, had_components);
Expand Down Expand Up @@ -1279,7 +1279,7 @@ psi_desc_teletext(mpegts_service_t *t, const uint8_t *ptr, int size,
*/
static int
psi_parse_pmt
(mpegts_service_t *t, const uint8_t *ptr, int len)
(mpegts_mux_t *mux, mpegts_service_t *t, const uint8_t *ptr, int len)
{
int ret = 0;
uint16_t pcr_pid, pid;
Expand Down Expand Up @@ -1376,7 +1376,7 @@ psi_parse_pmt
case 0x06:
/* 0x06 is Chinese Cable TV AC-3 audio track */
/* but mark it so only when no more descriptors exist */
if (dllen > 1)
if (dllen > 1 || !mux || !mux->mm_pmt_06_ac3)
break;
/* fall through to SCT_AC3 */
case 0x81:
Expand Down
7 changes: 7 additions & 0 deletions src/input/mpegts/mpegts_mux.c
Expand Up @@ -406,6 +406,13 @@ const idclass_t mpegts_mux_class =
.opts = PO_RDONLY | PO_NOSAVE,
.get = mpegts_mux_class_get_num_svc,
},
{
.type = PT_BOOL,
.id = "pmt_06_ac3",
.name = "PMT Descriptor 0x06 = AC-3",
.off = offsetof(mpegts_mux_t, mm_pmt_06_ac3),
.opts = PO_ADVANCED,
},
{}
}
};
Expand Down

0 comments on commit 3240a8e

Please sign in to comment.