Permalink
Browse files

Add labelling/filtering of Clean Effect and Hearing Impaired audio tr…

…acks
  • Loading branch information...
stuartm committed Nov 21, 2012
1 parent ee37534 commit ed7839a92f15c34b01bf008b63b3d758a2d6c42a
@@ -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;
@@ -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;
@@ -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];
@@ -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);
@@ -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:
@@ -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);

0 comments on commit ed7839a

Please sign in to comment.