aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/ffmpeg_plugin.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-07-19 16:24:43 +0100
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-07-19 16:54:11 +0100
commit37754559b8f934ce8d554e0d9f976d4f6eb376d9 (patch)
treeef1387a1a04da7b03065182b581e627f5ea9dda9 /src/decoder/ffmpeg_plugin.c
parent4100035b19a5d0dedcf8f71a272fa67f6a24361a (diff)
downloadmpd-37754559b8f934ce8d554e0d9f976d4f6eb376d9.tar.gz
mpd-37754559b8f934ce8d554e0d9f976d4f6eb376d9.tar.xz
mpd-37754559b8f934ce8d554e0d9f976d4f6eb376d9.zip
Add audio_format_init() function
It makes no difference right now, but we're about to add an endianness flag and will want to make sure it's correctly initialised every time.
Diffstat (limited to '')
-rw-r--r--src/decoder/ffmpeg_plugin.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c
index 03c46a732..f6003d2f3 100644
--- a/src/decoder/ffmpeg_plugin.c
+++ b/src/decoder/ffmpeg_plugin.c
@@ -267,6 +267,7 @@ ffmpeg_decode_internal(struct ffmpeg_context *ctx)
struct audio_format audio_format;
enum decoder_command cmd;
int total_time;
+ uint8_t bits;
total_time = 0;
@@ -275,13 +276,13 @@ ffmpeg_decode_internal(struct ffmpeg_context *ctx)
}
#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(41<<8)+0)
- audio_format.bits = (uint8_t) av_get_bits_per_sample_format(codec_context->sample_fmt);
+ bits = (uint8_t) av_get_bits_per_sample_format(codec_context->sample_fmt);
#else
/* XXX fixme 16-bit for older ffmpeg (13 Aug 2007) */
- audio_format.bits = (uint8_t) 16;
+ bits = (uint8_t) 16;
#endif
- audio_format.sample_rate = (unsigned int)codec_context->sample_rate;
- audio_format.channels = codec_context->channels;
+ audio_format_init(&audio_format, codec_context->sample_rate, bits,
+ codec_context->channels);
if (!audio_format_valid(&audio_format)) {
g_warning("Invalid audio format: %u:%u:%u\n",