diff options
author | Chris Robinson <[email protected]> | 2012-02-28 04:04:52 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-02-28 04:04:52 -0800 |
commit | 2747c87893481414d26100f8f2728be88246872c (patch) | |
tree | b4ed6e26bf73c8c7228b78a80e0c1fb980ebfb9f /examples/alffmpeg.c | |
parent | 2285c79ded9ff8a636e5a361279941218d084f71 (diff) |
Print out unsupported audio format info from ffmpeg
Diffstat (limited to 'examples/alffmpeg.c')
-rw-r--r-- | examples/alffmpeg.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/examples/alffmpeg.c b/examples/alffmpeg.c index b6619a57..ed4c46e0 100644 --- a/examples/alffmpeg.c +++ b/examples/alffmpeg.c @@ -381,7 +381,11 @@ int getAVAudioInfo(StreamPtr stream, ALuint *rate, ALenum *channels, ALenum *typ else if(stream->CodecCtx->sample_fmt == AV_SAMPLE_FMT_DBL) *type = AL_DOUBLE_SOFT; else + { + fprintf(stderr, "Unsupported ffmpeg sample format: %s\n", + av_get_sample_fmt_name(stream->CodecCtx->sample_fmt)); return 1; + } /* Get the OpenAL channel configuration using the channel layout detected * by ffmpeg. NOTE: some file types may not specify a channel layout. In @@ -392,7 +396,7 @@ int getAVAudioInfo(StreamPtr stream, ALuint *rate, ALenum *channels, ALenum *typ *channels = AL_STEREO_SOFT; else if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_QUAD) *channels = AL_QUAD_SOFT; - else if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_5POINT1) + else if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_5POINT1_BACK) *channels = AL_5POINT1_SOFT; else if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_7POINT1) *channels = AL_7POINT1_SOFT; @@ -404,10 +408,20 @@ int getAVAudioInfo(StreamPtr stream, ALuint *rate, ALenum *channels, ALenum *typ else if(stream->CodecCtx->channels == 2) *channels = AL_STEREO_SOFT; else + { + fprintf(stderr, "Unsupported ffmpeg raw channel count: %d\n", + stream->CodecCtx->channels); return 1; + } } else + { + char str[1024]; + av_get_channel_layout_string(str, sizeof(str), stream->CodecCtx->channels, + stream->CodecCtx->channel_layout); + fprintf(stderr, "Unsupported ffmpeg channel layout: %s\n", str); return 1; + } *rate = stream->CodecCtx->sample_rate; |