diff options
Diffstat (limited to 'src/decoder/libav_decoder_plugin.c')
-rw-r--r-- | src/decoder/libav_decoder_plugin.c | 12 |
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); |