1
0
Fork 0
forked from len0rd/rockbox

mpegplayer: Misc seeking tweaks 1) Consolidate some code amongst functions. 2) Be sure times retured from stream_get_seek_time are never before the start of the movie 3) Stop PCM when clearing it so the current audio being sent to the audio device is also cleared.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16014 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2008-01-07 14:58:23 +00:00
parent 9216d0f16a
commit 0e98d7e315
2 changed files with 87 additions and 114 deletions

View file

@ -152,12 +152,25 @@ void pcm_output_add_data(void)
/* Flushes the buffer - clock keeps counting */
void pcm_output_flush(void)
{
bool playing, paused;
rb->pcm_play_lock();
playing = rb->pcm_is_playing();
paused = rb->pcm_is_paused();
/* Stop PCM to clear current buffer */
if (playing)
rb->pcm_play_stop();
pcmbuf_threshold = PCMOUT_PLAY_WM;
pcmbuf_read = pcmbuf_written = 0;
pcmbuf_head = pcmbuf_tail = pcm_buffer;
/* Restart if playing state was current */
if (playing && !paused)
rb->pcm_play_data(get_more, NULL, 0);
rb->pcm_play_unlock();
}