decoder/fluidsynth: stop playback at end of file
Use libfluidsynth's new function fluid_player_get_status().
This commit is contained in:
1
NEWS
1
NEWS
@@ -3,6 +3,7 @@ ver 0.17.2 (2012/??/??)
|
|||||||
- fix crash in local file check
|
- fix crash in local file check
|
||||||
* decoder:
|
* decoder:
|
||||||
- fluidsynth: remove throttle (requires libfluidsynth 1.1)
|
- fluidsynth: remove throttle (requires libfluidsynth 1.1)
|
||||||
|
- fluidsynth: stop playback at end of file
|
||||||
- fluidsynth: check MIDI file format while scanning
|
- fluidsynth: check MIDI file format while scanning
|
||||||
* output:
|
* output:
|
||||||
- httpd: use monotonic clock, avoid hiccups after system clock adjustment
|
- httpd: use monotonic clock, avoid hiccups after system clock adjustment
|
||||||
|
@@ -168,7 +168,7 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
|
|||||||
|
|
||||||
decoder_initialized(decoder, &audio_format, false, -1);
|
decoder_initialized(decoder, &audio_format, false, -1);
|
||||||
|
|
||||||
do {
|
while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING) {
|
||||||
int16_t buffer[2048];
|
int16_t buffer[2048];
|
||||||
const unsigned max_frames = G_N_ELEMENTS(buffer) / 2;
|
const unsigned max_frames = G_N_ELEMENTS(buffer) / 2;
|
||||||
|
|
||||||
@@ -178,15 +178,14 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
|
|||||||
ret = fluid_synth_write_s16(synth, max_frames,
|
ret = fluid_synth_write_s16(synth, max_frames,
|
||||||
buffer, 0, 2,
|
buffer, 0, 2,
|
||||||
buffer, 1, 2);
|
buffer, 1, 2);
|
||||||
/* XXX how do we see whether the player is done? We
|
|
||||||
can't access the private attribute
|
|
||||||
player->status */
|
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
cmd = decoder_data(decoder, NULL, buffer, sizeof(buffer),
|
cmd = decoder_data(decoder, NULL, buffer, sizeof(buffer),
|
||||||
0);
|
0);
|
||||||
} while (cmd == DECODE_COMMAND_NONE);
|
if (cmd != DECODE_COMMAND_NONE)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user