diff options
author | Chris Robinson <[email protected]> | 2012-01-10 02:12:54 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-01-10 02:12:54 -0800 |
commit | d4670faafdf7a44392a281b57d3c6933a6bc22ad (patch) | |
tree | abd9beaa599ae6eaf57e0639f2d0fa563868caee /examples/alffmpeg.c | |
parent | e772fb7d0e1559915944de032c5fd0cb1370a8cf (diff) |
Fix compiling the example program, and support AL_SOFT_buffer_samples with it
Diffstat (limited to 'examples/alffmpeg.c')
-rw-r--r-- | examples/alffmpeg.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/alffmpeg.c b/examples/alffmpeg.c index 13cc0efe..424a07a6 100644 --- a/examples/alffmpeg.c +++ b/examples/alffmpeg.c @@ -370,15 +370,15 @@ int getAVAudioInfo(StreamPtr stream, ALuint *rate, ALenum *channels, ALenum *typ /* Get the sample type for OpenAL given the format detected by ffmpeg. */ if(stream->CodecCtx->sample_fmt == AV_SAMPLE_FMT_U8) - *type = AL_UNSIGNED_BYTE; + *type = AL_UNSIGNED_BYTE_SOFT; else if(stream->CodecCtx->sample_fmt == AV_SAMPLE_FMT_S16) - *type = AL_SHORT; + *type = AL_SHORT_SOFT; else if(stream->CodecCtx->sample_fmt == AV_SAMPLE_FMT_S32) - *type = AL_INT; + *type = AL_INT_SOFT; else if(stream->CodecCtx->sample_fmt == AV_SAMPLE_FMT_FLT) - *type = AL_FLOAT; + *type = AL_FLOAT_SOFT; else if(stream->CodecCtx->sample_fmt == AV_SAMPLE_FMT_DBL) - *type = AL_DOUBLE; + *type = AL_DOUBLE_SOFT; else return 1; @@ -386,22 +386,22 @@ int getAVAudioInfo(StreamPtr stream, ALuint *rate, ALenum *channels, ALenum *typ * by ffmpeg. NOTE: some file types may not specify a channel layout. In * that case, one must be guessed based on the channel count. */ if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_MONO) - *channels = AL_MONO; + *channels = AL_MONO_SOFT; else if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_STEREO) - *channels = AL_STEREO; + *channels = AL_STEREO_SOFT; else if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_QUAD) - *channels = AL_QUAD; + *channels = AL_QUAD_SOFT; else if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_5POINT1) - *channels = AL_5POINT1; + *channels = AL_5POINT1_SOFT; else if(stream->CodecCtx->channel_layout == AV_CH_LAYOUT_7POINT1) - *channels = AL_7POINT1; + *channels = AL_7POINT1_SOFT; else if(stream->CodecCtx->channel_layout == 0) { /* Unknown channel layout. Try to guess. */ if(stream->CodecCtx->channels == 1) - *channels = AL_MONO; + *channels = AL_MONO_SOFT; else if(stream->CodecCtx->channels == 2) - *channels = AL_STEREO; + *channels = AL_STEREO_SOFT; else return 1; } |