summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2009-11-09 05:43:19 +0000
committerJeffrey Goode <jeffg7@gmail.com>2009-11-09 05:43:19 +0000
commit20db9cc39e3019343ef94527c6d98414a55efd79 (patch)
tree77b43f61afb97b433557020d39e8201acec7e14f
parent4cd805cfaf88cee4b725b38f6a44b870f4c653e3 (diff)
downloadrockbox-20db9cc39e3019343ef94527c6d98414a55efd79.tar.gz
rockbox-20db9cc39e3019343ef94527c6d98414a55efd79.tar.bz2
rockbox-20db9cc39e3019343ef94527c6d98414a55efd79.zip
Playback: removed duplicate functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23576 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codec_thread.c17
-rw-r--r--apps/playback.c10
-rw-r--r--apps/playback.h2
3 files changed, 9 insertions, 20 deletions
diff --git a/apps/codec_thread.c b/apps/codec_thread.c
index e3f190e69c..acb0a5d646 100644
--- a/apps/codec_thread.c
+++ b/apps/codec_thread.c
@@ -262,7 +262,7 @@ static size_t codec_filebuf_callback(void *ptr, size_t size)
{
ssize_t copy_n;
- if (ci.stop_codec || !audio_is_playing())
+ if (ci.stop_codec || !(audio_status() & AUDIO_STATUS_PLAY))
return 0;
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;
void *ptr;
- if (!audio_is_playing())
+ if (!(audio_status() & AUDIO_STATUS_PLAY))
{
*realsize = 0;
return NULL;
@@ -335,16 +335,17 @@ static void codec_seek_complete_callback(void)
{
logf("seek_complete");
/* 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. */
- if (pcm_is_paused() || audio_is_paused())
+ bool audio_paused = audio_status() & AUDIO_STATUS_PAUSE;
+ if (pcm_is_paused() || audio_paused)
{
/* Clear the buffer */
pcmbuf_play_stop();
dsp_configure(ci.dsp, DSP_FLUSH, 0);
/* If seeking-while-playing, resume pcm playback */
- if (!audio_is_paused())
+ if (!audio_paused)
pcmbuf_pause(false);
}
ci.seek_time = 0;
@@ -364,7 +365,7 @@ static bool codec_request_next_track_callback(void)
{
int prev_codectype;
- if (ci.stop_codec || !audio_is_playing())
+ if (ci.stop_codec || !(audio_status() & AUDIO_STATUS_PLAY))
return false;
prev_codectype = get_codec_base_type(thistrack_id3->codectype);
@@ -542,7 +543,7 @@ static void codec_thread(void)
if (ci.stop_codec)
{
status = CODEC_OK;
- if (!audio_is_playing())
+ if (!(audio_status() & AUDIO_STATUS_PLAY))
pcmbuf_play_stop();
}
@@ -553,7 +554,7 @@ static void codec_thread(void)
case Q_CODEC_LOAD_DISK:
case 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)
{
diff --git a/apps/playback.c b/apps/playback.c
index fbaaa5c974..312a1c8165 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -2126,13 +2126,3 @@ int *get_codec_hid()
{
return &tracks[track_ridx].codec_hid;
}
-
-bool audio_is_playing(void)
-{
- return playing;
-}
-
-bool audio_is_paused(void)
-{
- return paused;
-}
diff --git a/apps/playback.h b/apps/playback.h
index c0fd15e590..b40638247b 100644
--- a/apps/playback.h
+++ b/apps/playback.h
@@ -74,8 +74,6 @@ void audio_post_track_change(bool pcmbuf);
int get_audio_hid(void);
int *get_codec_hid(void);
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 */
#if defined(HAVE_RECORDING) && !defined(SIMULATOR)