forked from len0rd/rockbox
Playback: removed duplicate functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23576 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4cd805cfaf
commit
20db9cc39e
3 changed files with 9 additions and 20 deletions
|
@ -262,7 +262,7 @@ static size_t codec_filebuf_callback(void *ptr, size_t size)
|
||||||
{
|
{
|
||||||
ssize_t copy_n;
|
ssize_t copy_n;
|
||||||
|
|
||||||
if (ci.stop_codec || !audio_is_playing())
|
if (ci.stop_codec || !(audio_status() & AUDIO_STATUS_PLAY))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
copy_n = bufread(get_audio_hid(), size, ptr);
|
copy_n = bufread(get_audio_hid(), size, ptr);
|
||||||
|
@ -284,7 +284,7 @@ static void* codec_request_buffer_callback(size_t *realsize, size_t reqsize)
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
if (!audio_is_playing())
|
if (!(audio_status() & AUDIO_STATUS_PLAY))
|
||||||
{
|
{
|
||||||
*realsize = 0;
|
*realsize = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -335,16 +335,17 @@ static void codec_seek_complete_callback(void)
|
||||||
{
|
{
|
||||||
logf("seek_complete");
|
logf("seek_complete");
|
||||||
/* If seeking-while-playing, pcm_is_paused() is true.
|
/* If seeking-while-playing, pcm_is_paused() is true.
|
||||||
* If seeking-while-paused, audio_is_paused() is true.
|
* If seeking-while-paused, audio_status PAUSE is true.
|
||||||
* A seamless seek skips this section. */
|
* A seamless seek skips this section. */
|
||||||
if (pcm_is_paused() || audio_is_paused())
|
bool audio_paused = audio_status() & AUDIO_STATUS_PAUSE;
|
||||||
|
if (pcm_is_paused() || audio_paused)
|
||||||
{
|
{
|
||||||
/* Clear the buffer */
|
/* Clear the buffer */
|
||||||
pcmbuf_play_stop();
|
pcmbuf_play_stop();
|
||||||
dsp_configure(ci.dsp, DSP_FLUSH, 0);
|
dsp_configure(ci.dsp, DSP_FLUSH, 0);
|
||||||
|
|
||||||
/* If seeking-while-playing, resume pcm playback */
|
/* If seeking-while-playing, resume pcm playback */
|
||||||
if (!audio_is_paused())
|
if (!audio_paused)
|
||||||
pcmbuf_pause(false);
|
pcmbuf_pause(false);
|
||||||
}
|
}
|
||||||
ci.seek_time = 0;
|
ci.seek_time = 0;
|
||||||
|
@ -364,7 +365,7 @@ static bool codec_request_next_track_callback(void)
|
||||||
{
|
{
|
||||||
int prev_codectype;
|
int prev_codectype;
|
||||||
|
|
||||||
if (ci.stop_codec || !audio_is_playing())
|
if (ci.stop_codec || !(audio_status() & AUDIO_STATUS_PLAY))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
prev_codectype = get_codec_base_type(thistrack_id3->codectype);
|
prev_codectype = get_codec_base_type(thistrack_id3->codectype);
|
||||||
|
@ -542,7 +543,7 @@ static void codec_thread(void)
|
||||||
if (ci.stop_codec)
|
if (ci.stop_codec)
|
||||||
{
|
{
|
||||||
status = CODEC_OK;
|
status = CODEC_OK;
|
||||||
if (!audio_is_playing())
|
if (!(audio_status() & AUDIO_STATUS_PLAY))
|
||||||
pcmbuf_play_stop();
|
pcmbuf_play_stop();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -553,7 +554,7 @@ static void codec_thread(void)
|
||||||
case Q_CODEC_LOAD_DISK:
|
case Q_CODEC_LOAD_DISK:
|
||||||
case Q_CODEC_LOAD:
|
case Q_CODEC_LOAD:
|
||||||
LOGFQUEUE("codec < Q_CODEC_LOAD");
|
LOGFQUEUE("codec < Q_CODEC_LOAD");
|
||||||
if (audio_is_playing())
|
if (audio_status() & AUDIO_STATUS_PLAY)
|
||||||
{
|
{
|
||||||
if (ci.new_track || status != CODEC_OK)
|
if (ci.new_track || status != CODEC_OK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2126,13 +2126,3 @@ int *get_codec_hid()
|
||||||
{
|
{
|
||||||
return &tracks[track_ridx].codec_hid;
|
return &tracks[track_ridx].codec_hid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool audio_is_playing(void)
|
|
||||||
{
|
|
||||||
return playing;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool audio_is_paused(void)
|
|
||||||
{
|
|
||||||
return paused;
|
|
||||||
}
|
|
||||||
|
|
|
@ -74,8 +74,6 @@ void audio_post_track_change(bool pcmbuf);
|
||||||
int get_audio_hid(void);
|
int get_audio_hid(void);
|
||||||
int *get_codec_hid(void);
|
int *get_codec_hid(void);
|
||||||
void audio_set_prev_elapsed(unsigned long setting);
|
void audio_set_prev_elapsed(unsigned long setting);
|
||||||
bool audio_is_playing(void);
|
|
||||||
bool audio_is_paused(void);
|
|
||||||
|
|
||||||
/* Define one constant that includes recording related functionality */
|
/* Define one constant that includes recording related functionality */
|
||||||
#if defined(HAVE_RECORDING) && !defined(SIMULATOR)
|
#if defined(HAVE_RECORDING) && !defined(SIMULATOR)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue