mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-15 11:07:38 -04:00
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:
parent
9216d0f16a
commit
0e98d7e315
2 changed files with 87 additions and 114 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue