aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-04 17:05:08 +0100
committerMax Kellermann <max@duempel.org>2008-11-04 17:05:08 +0100
commitfef14683aec32c9af22512f5890f2938ad4b5099 (patch)
treed71abae259394a1dc58062d2df6cb509c2d6bcd8 /src/decoder
parent11404b5d10f1a69efe401f64e659ac8c051a4678 (diff)
downloadmpd-fef14683aec32c9af22512f5890f2938ad4b5099.tar.gz
mpd-fef14683aec32c9af22512f5890f2938ad4b5099.tar.xz
mpd-fef14683aec32c9af22512f5890f2938ad4b5099.zip
mp4: get decoder command from decoder_data()
Eliminate a superfluous decoder_get_command() call. decoder_data() already returns the command.
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/mp4_plugin.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/decoder/mp4_plugin.c b/src/decoder/mp4_plugin.c
index 76c3482cc..f5a61fe03 100644
--- a/src/decoder/mp4_plugin.c
+++ b/src/decoder/mp4_plugin.c
@@ -128,6 +128,7 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
bool seeking = false;
double seek_where = 0;
bool initialized = false;
+ enum decoder_command cmd = DECODE_COMMAND_NONE;
mp4fh = mp4ff_open_read(&callback);
if (!mp4fh) {
@@ -191,8 +192,10 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
seek_table = g_malloc(sizeof(float) * num_samples);
- for (sample_id = 0; sample_id < num_samples; sample_id++) {
- if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK) {
+ for (sample_id = 0;
+ sample_id < num_samples && cmd != DECODE_COMMAND_STOP;
+ sample_id++) {
+ if (cmd == DECODE_COMMAND_SEEK) {
seeking = true;
seek_where = decoder_seek_where(mpd_decoder);
}
@@ -288,11 +291,9 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
sample_buffer += offset * channels * 2;
- decoder_data(mpd_decoder, input_stream, sample_buffer,
- sample_buffer_length, file_time,
- bit_rate, NULL);
- if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP)
- break;
+ cmd = decoder_data(mpd_decoder, input_stream,
+ sample_buffer, sample_buffer_length,
+ file_time, bit_rate, NULL);
}
free(seek_table);