decoder/wildmidi: move code to wildmidi_output()
This commit is contained in:
parent
62000670e3
commit
25deae6cc7
@ -65,6 +65,17 @@ wildmidi_finish(void)
|
||||
WildMidi_Shutdown();
|
||||
}
|
||||
|
||||
static DecoderCommand
|
||||
wildmidi_output(Decoder &decoder, midi *wm)
|
||||
{
|
||||
char buffer[4096];
|
||||
int length = WildMidi_GetOutput(wm, buffer, sizeof(buffer));
|
||||
if (length <= 0)
|
||||
return DecoderCommand::STOP;
|
||||
|
||||
return decoder_data(decoder, nullptr, buffer, length, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
wildmidi_file_decode(Decoder &decoder, Path path_fs)
|
||||
{
|
||||
@ -94,18 +105,11 @@ wildmidi_file_decode(Decoder &decoder, Path path_fs)
|
||||
|
||||
DecoderCommand cmd;
|
||||
do {
|
||||
char buffer[4096];
|
||||
int len;
|
||||
|
||||
info = WildMidi_GetInfo(wm);
|
||||
if (info == nullptr)
|
||||
break;
|
||||
|
||||
len = WildMidi_GetOutput(wm, buffer, sizeof(buffer));
|
||||
if (len <= 0)
|
||||
break;
|
||||
|
||||
cmd = decoder_data(decoder, nullptr, buffer, len, 0);
|
||||
cmd = wildmidi_output(decoder, wm);
|
||||
|
||||
if (cmd == DecoderCommand::SEEK) {
|
||||
unsigned long seek_where =
|
||||
|
Loading…
Reference in New Issue
Block a user