Parse the audio_type field of the iso639_language_descriptor - this indicates if the audio stream contains audio description for the hard of hearing. Use this value when regenerating the PMT for the passthrough muxer, and also include it in the HTSP stream description messages.

This commit is contained in:
Dave Chapman 2013-05-13 09:27:01 +01:00
parent 60bdb16c9d
commit 4b86d2fd20
5 changed files with 24 additions and 11 deletions

View 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)

View file

@ -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:

View 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;

View 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;

View 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;