forked from len0rd/rockbox
Deactivate the playback capabilites for targets with PLUGIN_BUFFER_SIZE <= 0x10000, as they're not capable of playback due to the use of plugin_get_audio_buffer().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21167 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4aec45e68f
commit
d3d66f172a
1 changed files with 24 additions and 7 deletions
|
@ -38,6 +38,11 @@ PLUGIN_HEADER
|
||||||
|
|
||||||
/******************************* Globals ***********************************/
|
/******************************* Globals ***********************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Targets which use plugin_get_audio_buffer() can't have playback from
|
||||||
|
* within pictureflow itself, as the whole core audio buffer is occupied */
|
||||||
|
#define PF_PLAYBACK_CAPABLE (PLUGIN_BUFFER_SIZE > 0x10000)
|
||||||
|
|
||||||
#define PF_PREV ACTION_STD_PREV
|
#define PF_PREV ACTION_STD_PREV
|
||||||
#define PF_PREV_REPEAT ACTION_STD_PREVREPEAT
|
#define PF_PREV_REPEAT ACTION_STD_PREVREPEAT
|
||||||
#define PF_NEXT ACTION_STD_NEXT
|
#define PF_NEXT ACTION_STD_NEXT
|
||||||
|
@ -254,7 +259,10 @@ struct track_data {
|
||||||
uint32_t sort;
|
uint32_t sort;
|
||||||
int name_idx; /* offset to the track name */
|
int name_idx; /* offset to the track name */
|
||||||
long seek;
|
long seek;
|
||||||
int filename_idx; /* offset to the filename in the string */
|
#if PF_PLAYBACK_CAPABLE
|
||||||
|
/* offset to the filename in the string, needed for playlist generation */
|
||||||
|
int filename_idx;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rect {
|
struct rect {
|
||||||
|
@ -757,14 +765,14 @@ char* get_track_name(const int track_index)
|
||||||
return track_names + tracks[track_index].name_idx;
|
return track_names + tracks[track_index].name_idx;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#if PF_PLAYBACK_CAPABLE
|
||||||
char* get_track_filename(const int track_index)
|
char* get_track_filename(const int track_index)
|
||||||
{
|
{
|
||||||
if ( track_index < track_count )
|
if ( track_index < track_count )
|
||||||
return track_names + tracks[track_index].filename_idx;
|
return track_names + tracks[track_index].filename_idx;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
Compare two unsigned ints passed via pointers.
|
Compare two unsigned ints passed via pointers.
|
||||||
*/
|
*/
|
||||||
|
@ -798,7 +806,7 @@ void create_track_index(const int slide_index)
|
||||||
tracks = (struct track_data*)(track_names + borrowed);
|
tracks = (struct track_data*)(track_names + borrowed);
|
||||||
while (rb->tagcache_get_next(&tcs))
|
while (rb->tagcache_get_next(&tcs))
|
||||||
{
|
{
|
||||||
int len = 0, fn_idx = 0, remain;
|
int len = 0, fn_idx = 0;
|
||||||
|
|
||||||
avail -= sizeof(struct track_data);
|
avail -= sizeof(struct track_data);
|
||||||
track_num = rb->tagcache_get_numeric(&tcs, tag_tracknumber) - 1;
|
track_num = rb->tagcache_get_numeric(&tcs, tag_tracknumber) - 1;
|
||||||
|
@ -824,7 +832,8 @@ retry:
|
||||||
}
|
}
|
||||||
if (fn_idx <= 0)
|
if (fn_idx <= 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
remain = avail - fn_idx;
|
#if PF_PLAYBACK_CAPABLE
|
||||||
|
int remain = avail - fn_idx;
|
||||||
if (remain >= MAX_PATH)
|
if (remain >= MAX_PATH)
|
||||||
{ /* retrieve filename for building the playlist */
|
{ /* retrieve filename for building the playlist */
|
||||||
rb->tagcache_retrieve(&tcs, tcs.idx_id, tag_filename,
|
rb->tagcache_retrieve(&tcs, tcs.idx_id, tag_filename,
|
||||||
|
@ -837,6 +846,9 @@ retry:
|
||||||
}
|
}
|
||||||
else /* request more buffer so that track and filename fit */
|
else /* request more buffer so that track and filename fit */
|
||||||
len = (avail - remain) + MAX_PATH;
|
len = (avail - remain) + MAX_PATH;
|
||||||
|
#else
|
||||||
|
len = fn_idx;
|
||||||
|
#endif
|
||||||
if (len > avail)
|
if (len > avail)
|
||||||
{
|
{
|
||||||
while (len > avail)
|
while (len > avail)
|
||||||
|
@ -863,7 +875,9 @@ retry:
|
||||||
tracks->sort = ((disc_num - 1) << 24) + (track_num << 14) + track_count;
|
tracks->sort = ((disc_num - 1) << 24) + (track_num << 14) + track_count;
|
||||||
tracks->name_idx = string_index;
|
tracks->name_idx = string_index;
|
||||||
tracks->seek = tcs.result_seek;
|
tracks->seek = tcs.result_seek;
|
||||||
|
#if PF_PLAYBACK_CAPABLE
|
||||||
tracks->filename_idx = fn_idx + string_index;
|
tracks->filename_idx = fn_idx + string_index;
|
||||||
|
#endif
|
||||||
track_count++;
|
track_count++;
|
||||||
string_index += len;
|
string_index += len;
|
||||||
}
|
}
|
||||||
|
@ -2325,6 +2339,7 @@ void select_prev_track(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PF_PLAYBACK_CAPABLE
|
||||||
/*
|
/*
|
||||||
* Puts the current tracklist into a newly created playlist and starts playling
|
* Puts the current tracklist into a newly created playlist and starts playling
|
||||||
*/
|
*/
|
||||||
|
@ -2367,7 +2382,7 @@ play:
|
||||||
old_playlist = center_slide.slide_index;
|
old_playlist = center_slide.slide_index;
|
||||||
old_shuffle = shuffle;
|
old_shuffle = shuffle;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
Draw the current album name
|
Draw the current album name
|
||||||
*/
|
*/
|
||||||
|
@ -2671,7 +2686,9 @@ int main(void)
|
||||||
pf_state = pf_cover_in;
|
pf_state = pf_cover_in;
|
||||||
}
|
}
|
||||||
else if ( pf_state == pf_show_tracks ) {
|
else if ( pf_state == pf_show_tracks ) {
|
||||||
|
#if PF_PLAYBACK_CAPABLE
|
||||||
start_playback();
|
start_playback();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2700,7 +2717,7 @@ enum plugin_status plugin_start(const void *parameter)
|
||||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||||
rb->cpu_boost(true);
|
rb->cpu_boost(true);
|
||||||
#endif
|
#endif
|
||||||
#if PLUGIN_BUFFER_SIZE > 0x10000
|
#if PF_PLAYBACK_CAPABLE
|
||||||
buf = rb->plugin_get_buffer(&buf_size);
|
buf = rb->plugin_get_buffer(&buf_size);
|
||||||
#else
|
#else
|
||||||
buf = rb->plugin_get_audio_buffer(&buf_size);
|
buf = rb->plugin_get_audio_buffer(&buf_size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue