From 364abb8eb2ea8fecc6fbbe2fe2cdd6c3fc2cf204 Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Fri, 25 Nov 2011 12:32:41 +0200 Subject: demux_ts: check if input plugin supports track languages when track language is unknown in demuxer --HG-- branch : point-release --- src/demuxers/demux_ts.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index b6f11c91f..084782f72 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -2348,10 +2348,14 @@ static int demux_ts_get_optional_data(demux_plugin_t *this_gen, { case DEMUX_OPTIONAL_DATA_AUDIOLANG: if ((channel >= 0) && (channel < this->audio_tracks_count)) { - if (this->audio_tracks[channel].lang[0]) + if (this->audio_tracks[channel].lang[0]) { strcpy(str, this->audio_tracks[channel].lang); - else + } else { + /* input plugin may know the language */ + if (this->input->get_capabilities(this->input) & INPUT_CAP_AUDIOLANG) + return DEMUX_OPTIONAL_UNSUPPORTED; sprintf(str, "%3i", channel); + } } else { strcpy(str, "none"); @@ -2363,6 +2367,9 @@ static int demux_ts_get_optional_data(demux_plugin_t *this_gen, if (this->spu_langs[channel].desc.lang[0]) { strcpy(str, this->spu_langs[channel].desc.lang); } else { + /* input plugin may know the language */ + if (this->input->get_capabilities(this->input) & INPUT_CAP_SPULANG) + return DEMUX_OPTIONAL_UNSUPPORTED; sprintf(str, "%3i", channel); } } else { -- cgit v1.2.3