diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-23 15:30:50 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-02-20 09:18:29 +0100 |
commit | 0bbe5ac82ef2845efafbf190044f16712db113b2 (patch) | |
tree | ac8745fba01c8a3e902e886f46f90ad56576559f /src/output/openal_output_plugin.c | |
parent | c69c8ffa9ec55c94dee7ce69af26b4edbd61647e (diff) |
Switch to Libav sample formats everywhere.
Drop 24bit format for now. It should be restored later by properly
distinguishing between internal and packed formats.
Diffstat (limited to 'src/output/openal_output_plugin.c')
-rw-r--r-- | src/output/openal_output_plugin.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/output/openal_output_plugin.c b/src/output/openal_output_plugin.c index ebd35ef1..dac9e54e 100644 --- a/src/output/openal_output_plugin.c +++ b/src/output/openal_output_plugin.c @@ -23,6 +23,8 @@ #include <glib.h> +#include <libavutil/samplefmt.h> + #ifndef HAVE_OSX #include <AL/al.h> #include <AL/alc.h> @@ -56,15 +58,10 @@ openal_output_quark(void) return g_quark_from_static_string("openal_output"); } -static ALenum -openal_audio_format(struct audio_format *audio_format) +static ALenum openal_audio_format(struct audio_format *audio_format) { - /* note: cannot map SAMPLE_FORMAT_S8 to AL_FORMAT_STEREO8 or - AL_FORMAT_MONO8 since OpenAL expects unsigned 8 bit - samples, while MPD uses signed samples */ - switch (audio_format->format) { - case SAMPLE_FORMAT_S16: + case AV_SAMPLE_FMT_S16: if (audio_format->channels == 2) return AL_FORMAT_STEREO16; if (audio_format->channels == 1) @@ -76,7 +73,7 @@ openal_audio_format(struct audio_format *audio_format) default: /* fall back to 16 bit */ - audio_format->format = SAMPLE_FORMAT_S16; + audio_format->format = AV_SAMPLE_FMT_S16; return openal_audio_format(audio_format); } } |