mp4: get decoder command from decoder_data()
Eliminate a superfluous decoder_get_command() call. decoder_data() already returns the command.
This commit is contained in:
parent
11404b5d10
commit
fef14683ae
@ -128,6 +128,7 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream)
|
|||||||
bool seeking = false;
|
bool seeking = false;
|
||||||
double seek_where = 0;
|
double seek_where = 0;
|
||||||
bool initialized = false;
|
bool initialized = false;
|
||||||
|
enum decoder_command cmd = DECODE_COMMAND_NONE;
|
||||||
|
|
||||||
mp4fh = mp4ff_open_read(&callback);
|
mp4fh = mp4ff_open_read(&callback);
|
||||||
if (!mp4fh) {
|
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);
|
seek_table = g_malloc(sizeof(float) * num_samples);
|
||||||
|
|
||||||
for (sample_id = 0; sample_id < num_samples; sample_id++) {
|
for (sample_id = 0;
|
||||||
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_SEEK) {
|
sample_id < num_samples && cmd != DECODE_COMMAND_STOP;
|
||||||
|
sample_id++) {
|
||||||
|
if (cmd == DECODE_COMMAND_SEEK) {
|
||||||
seeking = true;
|
seeking = true;
|
||||||
seek_where = decoder_seek_where(mpd_decoder);
|
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;
|
sample_buffer += offset * channels * 2;
|
||||||
|
|
||||||
decoder_data(mpd_decoder, input_stream, sample_buffer,
|
cmd = decoder_data(mpd_decoder, input_stream,
|
||||||
sample_buffer_length, file_time,
|
sample_buffer, sample_buffer_length,
|
||||||
bit_rate, NULL);
|
file_time, bit_rate, NULL);
|
||||||
if (decoder_get_command(mpd_decoder) == DECODE_COMMAND_STOP)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(seek_table);
|
free(seek_table);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user