diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-06 22:29:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-06 22:29:19 +0200 |
commit | 0318013afcffe0c3b8a0f0bf9f5f527098f6fa47 (patch) | |
tree | 19161b4c6a472b9d332e79a3a517b50af7eadd7b /libavformat | |
parent | 1caff5731d9a9f98de9e50569bac0d2d487e9e53 (diff) | |
parent | 6c8c7c246280cdcd23e4d99006b95245ae837278 (diff) | |
download | ffmpeg-0318013afcffe0c3b8a0f0bf9f5f527098f6fa47.tar.gz |
Merge commit '6c8c7c246280cdcd23e4d99006b95245ae837278'
* commit '6c8c7c246280cdcd23e4d99006b95245ae837278':
dump: Print AVAudioServiceType side data
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/dump.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c index 9a7035c323..6355b99f41 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -293,6 +293,49 @@ static void dump_stereo3d(void *ctx, AVPacketSideData *sd) av_log(ctx, AV_LOG_INFO, " (inverted)"); } +static void dump_audioservicetype(void *ctx, AVPacketSideData *sd) +{ + enum AVAudioServiceType *ast = (enum AVAudioServiceType *)sd->data; + + if (sd->size < sizeof(*ast)) { + av_log(ctx, AV_LOG_INFO, "invalid data"); + return; + } + + switch (*ast) { + case AV_AUDIO_SERVICE_TYPE_MAIN: + av_log(ctx, AV_LOG_INFO, "main"); + break; + case AV_AUDIO_SERVICE_TYPE_EFFECTS: + av_log(ctx, AV_LOG_INFO, "effects"); + break; + case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED: + av_log(ctx, AV_LOG_INFO, "visually impaired"); + break; + case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED: + av_log(ctx, AV_LOG_INFO, "hearing impaired"); + break; + case AV_AUDIO_SERVICE_TYPE_DIALOGUE: + av_log(ctx, AV_LOG_INFO, "dialogue"); + break; + case AV_AUDIO_SERVICE_TYPE_COMMENTARY: + av_log(ctx, AV_LOG_INFO, "comentary"); + break; + case AV_AUDIO_SERVICE_TYPE_EMERGENCY: + av_log(ctx, AV_LOG_INFO, "emergency"); + break; + case AV_AUDIO_SERVICE_TYPE_VOICE_OVER: + av_log(ctx, AV_LOG_INFO, "voice over"); + break; + case AV_AUDIO_SERVICE_TYPE_KARAOKE: + av_log(ctx, AV_LOG_INFO, "karaoke"); + break; + default: + av_log(ctx, AV_LOG_WARNING, "unknown"); + break; + } +} + static void dump_sidedata(void *ctx, AVStream *st, const char *indent) { int i; @@ -330,6 +373,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent) av_log(ctx, AV_LOG_INFO, "stereo3d: "); dump_stereo3d(ctx, &sd); break; + case AV_PKT_DATA_AUDIO_SERVICE_TYPE: + av_log(ctx, AV_LOG_INFO, "audio service type: "); + dump_audioservicetype(ctx, &sd); + break; default: av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d bytes)", sd.type, sd.size); |