aboutsummaryrefslogtreecommitdiff
path: root/src/decoder/libav_decoder_plugin.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-23 15:30:50 +0200
committerAnton Khirnov <anton@khirnov.net>2015-02-20 09:18:29 +0100
commit0bbe5ac82ef2845efafbf190044f16712db113b2 (patch)
treeac8745fba01c8a3e902e886f46f90ad56576559f /src/decoder/libav_decoder_plugin.c
parentc69c8ffa9ec55c94dee7ce69af26b4edbd61647e (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/decoder/libav_decoder_plugin.c')
-rw-r--r--src/decoder/libav_decoder_plugin.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/decoder/libav_decoder_plugin.c b/src/decoder/libav_decoder_plugin.c
index 05b9b2fb..a1e05b6b 100644
--- a/src/decoder/libav_decoder_plugin.c
+++ b/src/decoder/libav_decoder_plugin.c
@@ -42,6 +42,7 @@
#include <libavutil/mathematics.h>
#include <libavutil/dict.h>
#include <libavutil/opt.h>
+#include <libavutil/samplefmt.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "libav"
@@ -203,15 +204,6 @@ static enum decoder_command libav_send_packet(struct decoder *decoder,
return cmd;
}
-static enum sample_format libav_sample_format(const AVCodecContext *codec_context)
-{
- switch (codec_context->sample_fmt) {
- case AV_SAMPLE_FMT_S16: return SAMPLE_FORMAT_S16;
- case AV_SAMPLE_FMT_S32: return SAMPLE_FORMAT_S32;
- default: return SAMPLE_FORMAT_UNDEFINED;
- }
-}
-
static void libav_decode(struct decoder *decoder, struct input_stream *input)
{
LibavDecContext s = { .decoder = decoder };
@@ -236,7 +228,7 @@ static void libav_decode(struct decoder *decoder, struct input_stream *input)
if (!audio_format_init_checked(&audio_format,
dec->sample_rate,
- libav_sample_format(dec),
+ dec->sample_fmt,
dec->channels, &error)) {
g_warning("%s", error->message);
g_error_free(error);