diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:05 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:05 +0200 |
commit | 4590a98f0eb9484e185e7e0c25a3373c8e9076ea (patch) | |
tree | 94ea0d53bdf0b7f9b81ff679b0fb4466d971b1e5 /src/inputPlugins/mp4_plugin.c | |
parent | 0d45870cea6836cd48e6953f4e67756b2502e22c (diff) | |
download | mpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.tar.gz mpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.tar.xz mpd-4590a98f0eb9484e185e7e0c25a3373c8e9076ea.zip |
added audio_format parameter to decoder_initialized()
dc->audioFormat is set once by the decoder plugins before invoking
decoder_initialized(); hide dc->audioFormat and let the decoder pass
an AudioFormat pointer to decoder_initialized().
Diffstat (limited to 'src/inputPlugins/mp4_plugin.c')
-rw-r--r-- | src/inputPlugins/mp4_plugin.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c index f917ec345..d2c0f1b6c 100644 --- a/src/inputPlugins/mp4_plugin.c +++ b/src/inputPlugins/mp4_plugin.c @@ -88,6 +88,7 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream) faacDecHandle decoder; faacDecFrameInfo frameInfo; faacDecConfigurationPtr config; + AudioFormat audio_format; unsigned char *mp4Buffer; unsigned int mp4BufferSize; uint32_t sampleRate; @@ -139,7 +140,7 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream) #endif faacDecSetConfiguration(decoder, config); - dc.audioFormat.bits = 16; + audio_format.bits = 16; mp4Buffer = NULL; mp4BufferSize = 0; @@ -154,8 +155,8 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream) return -1; } - dc.audioFormat.sampleRate = sampleRate; - dc.audioFormat.channels = channels; + audio_format.sampleRate = sampleRate; + audio_format.channels = channels; file_time = mp4ff_get_track_duration_use_offsets(mp4fh, track); scale = mp4ff_time_scale(mp4fh, track); @@ -245,11 +246,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream) #ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE scale = frameInfo.samplerate; #endif - dc.audioFormat.sampleRate = scale; - dc.audioFormat.channels = frameInfo.channels; - getOutputAudioFormat(&(dc.audioFormat), - &(ob.audioFormat)); - decoder_initialized(mpd_decoder); + audio_format.sampleRate = scale; + audio_format.channels = frameInfo.channels; + decoder_initialized(mpd_decoder, &audio_format); } if (channels * (unsigned long)(dur + offset) > frameInfo.samples) { |