Skip to content

Commit

Permalink
Add labelling/filtering of Clean Effect and Hearing Impaired audio tr…
Browse files Browse the repository at this point in the history
…acks
  • Loading branch information
stuartm committed Nov 21, 2012
1 parent ee37534 commit ed7839a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
28 changes: 22 additions & 6 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -2353,6 +2353,12 @@ AudioTrackType AvFormatDecoder::GetAudioTrackType(uint stream_index)
const ProgramMapTable pmt(psip);
switch (pmt.GetAudioType(stream_index))
{
case 0x01 :
type = kAudioTypeCleanEffects;
break;
case 0x02 :
type = kAudioTypeHearingImpaired;
break;
case 0x03 :
type = kAudioTypeAudioDescription;
break;
Expand All @@ -2368,6 +2374,10 @@ AudioTrackType AvFormatDecoder::GetAudioTrackType(uint stream_index)
type = kAudioTypeAudioDescription;
else if (stream->disposition & AV_DISPOSITION_COMMENT)
type = kAudioTypeCommentary;
else if (stream->disposition & AV_DISPOSITION_HEARING_IMPAIRED)
type = kAudioTypeHearingImpaired;
else if (stream->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
type = kAudioTypeCleanEffects;
}

return type;
Expand Down Expand Up @@ -3703,12 +3713,8 @@ QString AvFormatDecoder::GetTrackDesc(uint type, uint trackNo) const

switch (tracks[type][trackNo].audio_type)
{
case kAudioTypeAudioDescription :
case kAudioTypeCommentary :
msg += QString(" (%1)")
.arg(toString(tracks[type][trackNo].audio_type));
break;
case kAudioTypeNormal : default :
case kAudioTypeNormal :
{
int av_index = tracks[kTrackTypeAudio][trackNo].av_stream_index;
AVStream *s = ic->streams[av_index];

Expand All @@ -3734,6 +3740,16 @@ QString AvFormatDecoder::GetTrackDesc(uint type, uint trackNo) const
}

break;
}
case kAudioTypeAudioDescription :
case kAudioTypeCommentary :
case kAudioTypeHearingImpaired :
case kAudioTypeCleanEffects :
case kAudioTypeSpokenSubs :
default :
msg += QString(" (%1)")
.arg(toString(tracks[type][trackNo].audio_type));
break;
}

return QString("%1: %2").arg(trackNo + 1).arg(msg);
Expand Down
16 changes: 14 additions & 2 deletions mythtv/libs/libmythtv/decoderbase.cpp
Expand Up @@ -1112,10 +1112,22 @@ QString toString(AudioTrackType type)
{
case kAudioTypeAudioDescription :
str = QObject::tr("Audio Description",
"Audio described for the visually impaired");
"On-screen events described for the visually impaired");
break;
case kAudioTypeCleanEffects :
str = QObject::tr("Clean Effects",
"No dialog, background audio only");
break;
case kAudioTypeHearingImpaired :
str = QObject::tr("Hearing Impaired",
"Clear dialog for the hearing impaired");
break;
case kAudioTypeSpokenSubs :
str = QObject::tr("Spoken Subtitles",
"Subtitles are read out for the visually impaired");
break;
case kAudioTypeCommentary :
str = QObject::tr("Commentary", "Audio commentary track");
str = QObject::tr("Commentary", "Director/Cast commentary track");
break;
case kAudioTypeNormal :
default:
Expand Down
7 changes: 5 additions & 2 deletions mythtv/libs/libmythtv/decoderbase.h
Expand Up @@ -51,8 +51,11 @@ typedef enum DecodeTypes
typedef enum AudioTrackType
{
kAudioTypeNormal = 0,
kAudioTypeAudioDescription,
kAudioTypeCommentary
kAudioTypeAudioDescription, // Audio Description for the visually impaired
kAudioTypeCleanEffects, // No dialog, soundtrack or effects only e.g. Karaoke
kAudioTypeHearingImpaired, // Greater contrast between dialog and background audio
kAudioTypeSpokenSubs, // Spoken subtitles for the visually impaired
kAudioTypeCommentary // Director/actor/etc Commentary
} AudioTrackType;
QString toString(AudioTrackType type);

Expand Down

0 comments on commit ed7839a

Please sign in to comment.