diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-03-04 14:44:43 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2012-03-04 14:50:47 -0500 |
commit | d18a5cad7f002b2f67385e57118048ea3db185a6 (patch) | |
tree | 61b8eafcf9d0197a8bc1f6c795c775f9170a4f64 /firmware | |
parent | 534117d1e0d01b78d0ab9040e64fbd88213cd805 (diff) | |
download | rockbox-d18a5cad7f002b2f67385e57118048ea3db185a6.tar.gz rockbox-d18a5cad7f002b2f67385e57118048ea3db185a6.zip |
Tweak paramters of mp3_play_data and callback.
Use generic void * and size_t and make mp3_play_data and its callback
agree on types. Use mp3_play_callback_t instead of prototyping
right in the function call (so it's not so messy to look at). Change
doesn't appear to require plugin API version increment.
Change-Id: Idcab2740ee316a2beb6e0a87b8f4934d9d6b3dd8
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/mp3_playback.h | 8 | ||||
-rw-r--r-- | firmware/target/sh/archos/audio-archos.c | 9 |
2 files changed, 9 insertions, 8 deletions
diff --git a/firmware/export/mp3_playback.h b/firmware/export/mp3_playback.h index 6fdaa31cac..de27a2a46d 100644 --- a/firmware/export/mp3_playback.h +++ b/firmware/export/mp3_playback.h | |||
@@ -26,6 +26,9 @@ | |||
26 | 26 | ||
27 | #include <stdbool.h> | 27 | #include <stdbool.h> |
28 | 28 | ||
29 | /* callback fn */ | ||
30 | typedef void (*mp3_play_callback_t)(const void **start, size_t* size); | ||
31 | |||
29 | /* functions formerly in mpeg.c */ | 32 | /* functions formerly in mpeg.c */ |
30 | void mp3_init(int volume, int bass, int treble, int balance, int loudness, | 33 | void mp3_init(int volume, int bass, int treble, int balance, int loudness, |
31 | int avc, int channel_config, int stereo_width, | 34 | int avc, int channel_config, int stereo_width, |
@@ -42,9 +45,8 @@ void demand_irq_enable(bool on); | |||
42 | #if CONFIG_CODEC == MAS3587F | 45 | #if CONFIG_CODEC == MAS3587F |
43 | void mp3_play_init(void); | 46 | void mp3_play_init(void); |
44 | #endif | 47 | #endif |
45 | void mp3_play_data(const unsigned char* start, int size, | 48 | void mp3_play_data(const void* start, size_t size, |
46 | void (*get_more)(unsigned char** start, size_t* size) /* callback fn */ | 49 | mp3_play_callback_t get_more); |
47 | ); | ||
48 | void mp3_play_pause(bool play); | 50 | void mp3_play_pause(bool play); |
49 | bool mp3_pause_done(void); | 51 | bool mp3_pause_done(void); |
50 | void mp3_play_stop(void); | 52 | void mp3_play_stop(void); |
diff --git a/firmware/target/sh/archos/audio-archos.c b/firmware/target/sh/archos/audio-archos.c index 9dfcb9cb97..2c2579bec5 100644 --- a/firmware/target/sh/archos/audio-archos.c +++ b/firmware/target/sh/archos/audio-archos.c | |||
@@ -53,7 +53,7 @@ static bool paused; /* playback is paused */ | |||
53 | static bool playing; /* We are playing an MP3 stream */ | 53 | static bool playing; /* We are playing an MP3 stream */ |
54 | 54 | ||
55 | /* the registered callback function to ask for more mp3 data */ | 55 | /* the registered callback function to ask for more mp3 data */ |
56 | static void (*callback_for_more)(unsigned char**, size_t*); | 56 | static mp3_play_callback_t callback_for_more; |
57 | 57 | ||
58 | /* list of tracks in memory */ | 58 | /* list of tracks in memory */ |
59 | #define MAX_ID3_TAGS (1<<4) /* Must be power of 2 */ | 59 | #define MAX_ID3_TAGS (1<<4) /* Must be power of 2 */ |
@@ -156,7 +156,7 @@ static void play_tick(void) | |||
156 | void DEI3(void) __attribute__((interrupt_handler)); | 156 | void DEI3(void) __attribute__((interrupt_handler)); |
157 | void DEI3(void) | 157 | void DEI3(void) |
158 | { | 158 | { |
159 | unsigned char* start; | 159 | const void* start; |
160 | size_t size = 0; | 160 | size_t size = 0; |
161 | 161 | ||
162 | if (callback_for_more != NULL) | 162 | if (callback_for_more != NULL) |
@@ -469,9 +469,8 @@ void mp3_play_init(void) | |||
469 | } | 469 | } |
470 | #endif | 470 | #endif |
471 | 471 | ||
472 | void mp3_play_data(const unsigned char* start, int size, | 472 | void mp3_play_data(const void* start, size_t size, |
473 | void (*get_more)(unsigned char** start, size_t* size) /* callback fn */ | 473 | mp3_play_callback_t get_more) |
474 | ) | ||
475 | { | 474 | { |
476 | /* init DMA */ | 475 | /* init DMA */ |
477 | DAR3 = 0x5FFFEC3; | 476 | DAR3 = 0x5FFFEC3; |