Enforce maximum sampling rate when starting player

Return -XMP_ERROR_INVALID if the player is started with an invalid
sampling rate.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Remove enable sample load API call from docs

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Fix buffer pointer for PCM data copy and end check

Change xmp_play_buffer() to return -1 in the first invalid buffer
instead of the last valid one, to be consistent with xmp_play_frame().
Also use a static variable to hold frame info buffer data.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Increase maximum sampling rate

Set the maximum sampling rate to 49170 Hz, used in the Atari Falcon
(reported by Miro Kropáček)

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
[test] Add xmp_start_player API call test

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
[test] Add test for xmp_play_buffer API call

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add internal state reset for xmp_play_buffer

When xmp_play_buffer is called with the output buffer set to NULL
it resets its internal state and synchronizes buffer start with
frame start. It's used mainly by the test code to synchronize
the first frame of a song with the start of a buffer.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Fix loop count reset when restarting module

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Add loop control for buffer fill function

Buffer fill is asynchronous with frame play, so loop control must be
performed inside the buffer fill function (otherwise we may place loop
data in the buffer when we don't want loops).

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>