summaryrefslogtreecommitdiffstats
path: root/lib/rbcodec
diff options
context:
space:
mode:
authorSean Bartell <wingedtachikoma@gmail.com>2011-08-12 01:27:13 -0400
committerNils Wallménius <nils@rockbox.org>2012-04-28 09:07:40 +0200
commitfe3d58004cf28fb98dd29159187d256aaf5d0781 (patch)
tree0bab6252f0f282675878c15183c5c660b52dc233 /lib/rbcodec
parentb794cbbdca28989ca357cec44e4d2df5e9fb67bd (diff)
downloadrockbox-fe3d58004cf28fb98dd29159187d256aaf5d0781.tar.gz
rockbox-fe3d58004cf28fb98dd29159187d256aaf5d0781.zip
rbcodec refactoring: get_audio_base_data_type
This function has been changed to rbcodec_format_is_atomic, which doesn't require an enum from the kernel. Change-Id: I1d537605087fe130a9b545509d7b8a340806dbf2 Reviewed-on: http://gerrit.rockbox.org/141 Reviewed-by: Nils Wallménius <nils@rockbox.org> Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec')
-rw-r--r--lib/rbcodec/metadata/metadata.c12
-rw-r--r--lib/rbcodec/metadata/metadata.h2
-rw-r--r--lib/rbcodec/test/warble.c2
3 files changed, 6 insertions, 10 deletions
diff --git a/lib/rbcodec/metadata/metadata.c b/lib/rbcodec/metadata/metadata.c
index b91e00cc4e..6837e97316 100644
--- a/lib/rbcodec/metadata/metadata.c
+++ b/lib/rbcodec/metadata/metadata.c
@@ -307,10 +307,10 @@ int get_audio_base_codec_type(int type)
}
/* Get the basic audio type */
-enum data_type get_audio_base_data_type(int afmt)
+bool rbcodec_format_is_atomic(int afmt)
{
if ((unsigned)afmt >= AFMT_NUM_CODECS)
- return TYPE_UNKNOWN;
+ return false;
switch (get_audio_base_codec_type(afmt))
{
@@ -327,15 +327,11 @@ enum data_type get_audio_base_data_type(int afmt)
case AFMT_KSS:
/* Type must be allocated and loaded in its entirety onto
the buffer */
- return TYPE_ATOMIC_AUDIO;
+ return true;
default:
/* Assume type may be loaded and discarded incrementally */
- return TYPE_PACKET_AUDIO;
-
- case AFMT_UNKNOWN:
- /* Have no idea at all */
- return TYPE_UNKNOWN;
+ return false;
}
}
diff --git a/lib/rbcodec/metadata/metadata.h b/lib/rbcodec/metadata/metadata.h
index 55e4d76f25..5a1c17bc11 100644
--- a/lib/rbcodec/metadata/metadata.h
+++ b/lib/rbcodec/metadata/metadata.h
@@ -340,7 +340,7 @@ void wipe_mp3entry(struct mp3entry *id3);
void fill_metadata_from_path(struct mp3entry *id3, const char *trackname);
int get_audio_base_codec_type(int type);
void strip_tags(int handle_id);
-enum data_type get_audio_base_data_type(int afmt);
+bool rbcodec_format_is_atomic(int afmt);
bool format_buffers_with_offset(int afmt);
#endif
diff --git a/lib/rbcodec/test/warble.c b/lib/rbcodec/test/warble.c
index e3d9456f4d..8dc27da9eb 100644
--- a/lib/rbcodec/test/warble.c
+++ b/lib/rbcodec/test/warble.c
@@ -475,7 +475,7 @@ static size_t ci_read_filebuf(void *ptr, size_t size)
static void *ci_request_buffer(size_t *realsize, size_t reqsize)
{
free(input_buffer);
- if (get_audio_base_data_type(ci.id3->codectype) == TYPE_PACKET_AUDIO)
+ if (!rbcodec_format_is_atomic(ci.id3->codectype))
reqsize = MIN(reqsize, 32 * 1024);
input_buffer = malloc(reqsize);
*realsize = read(input_fd, input_buffer, reqsize);