diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-02-23 08:14:46 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2012-03-03 07:23:38 +0100 |
commit | 286a4c5caa1945c8d1cb365a3d90fb09d5700cb2 (patch) | |
tree | 4835f46d16ec78d035ec9f49333079fe618384c1 /apps/plugins/pitch_detector.c | |
parent | 3f82f3aca14eb954e55f761721ffdd2684f0e812 (diff) | |
download | rockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.tar.gz rockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.zip |
Revise the PCM callback system after adding multichannel audio.
Additional status callback is added to pcm_play/rec_data instead of
using a special function to set it. Status includes DMA error
reporting to the status callback. Playback and recording callback
become more alike except playback uses "const void **addr" (because
the data should not be altered) and recording uses "void **addr".
"const" is put in place throughout where appropriate.
Most changes are fairly trivial. One that should be checked in
particular because it isn't so much is telechips, if anyone cares to
bother. PP5002 is not so trivial either but that tested as working.
Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2
Reviewed-on: http://gerrit.rockbox.org/166
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'apps/plugins/pitch_detector.c')
-rw-r--r-- | apps/plugins/pitch_detector.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c index c30d48a025..4ae43b3236 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c | |||
@@ -952,7 +952,7 @@ static uint32_t ICODE_ATTR buffer_magnitude(int16_t *input) | |||
952 | } | 952 | } |
953 | 953 | ||
954 | /* Stop the recording when the buffer is full */ | 954 | /* Stop the recording when the buffer is full */ |
955 | static void recording_callback(int status, void **start, size_t *size) | 955 | static void recording_callback(void **start, size_t *size) |
956 | { | 956 | { |
957 | int tail = audio_tail ^ 1; | 957 | int tail = audio_tail ^ 1; |
958 | 958 | ||
@@ -963,8 +963,6 @@ static void recording_callback(int status, void **start, size_t *size) | |||
963 | /* Always record full buffer, even if not required */ | 963 | /* Always record full buffer, even if not required */ |
964 | *start = audio_data[tail]; | 964 | *start = audio_data[tail]; |
965 | *size = BUFFER_SIZE * sizeof (int16_t); | 965 | *size = BUFFER_SIZE * sizeof (int16_t); |
966 | |||
967 | (void)status; | ||
968 | } | 966 | } |
969 | #endif /* SIMULATOR */ | 967 | #endif /* SIMULATOR */ |
970 | 968 | ||
@@ -973,7 +971,8 @@ static void record_data(void) | |||
973 | { | 971 | { |
974 | #ifndef SIMULATOR | 972 | #ifndef SIMULATOR |
975 | /* Always record full buffer, even if not required */ | 973 | /* Always record full buffer, even if not required */ |
976 | rb->pcm_record_data(recording_callback, audio_data[audio_tail], | 974 | rb->pcm_record_data(recording_callback, NULL, |
975 | audio_data[audio_tail], | ||
977 | BUFFER_SIZE * sizeof (int16_t)); | 976 | BUFFER_SIZE * sizeof (int16_t)); |
978 | #endif | 977 | #endif |
979 | } | 978 | } |