summaryrefslogtreecommitdiffstats
path: root/apps/codecs/mp3_enc.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-11-28 07:23:13 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-11-28 07:23:13 +0000
commit546d0dd4e6a00e31389a4ea76159dfc5e330961b (patch)
tree935fa7e45ec164a985b7ca73656def23372ef46a /apps/codecs/mp3_enc.c
parent8fb25b7c3e5c2eced91d88ebc93b7d687ef45695 (diff)
downloadrockbox-546d0dd4e6a00e31389a4ea76159dfc5e330961b.tar.gz
rockbox-546d0dd4e6a00e31389a4ea76159dfc5e330961b.zip
Recording: Change some encoder code the operation of which was apparantly unclear. It seems clearer now anyway. No functional changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19255 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/mp3_enc.c')
-rw-r--r--apps/codecs/mp3_enc.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/apps/codecs/mp3_enc.c b/apps/codecs/mp3_enc.c
index 555e981a06..18aa1bfe1a 100644
--- a/apps/codecs/mp3_enc.c
+++ b/apps/codecs/mp3_enc.c
@@ -2469,7 +2469,7 @@ static void on_rec_new_stream(struct enc_buffer_event_data *data)
else if (data->flags & CHUNKF_PRERECORD)
{
/* nothing to add and we cannot change prerecorded data */
- }
+ }
else if (data->flags & CHUNKF_START_FILE)
{
/* starting fresh ... be sure to flush encoder first */
@@ -2490,31 +2490,35 @@ STATICIRAM void enc_events_callback(enum enc_events event, void *data)
ICODE_ATTR;
STATICIRAM void enc_events_callback(enum enc_events event, void *data)
{
- if (event == ENC_WRITE_CHUNK)
+ switch (event)
{
+ case ENC_WRITE_CHUNK:
if (on_write_chunk((struct enc_file_event_data *)data))
return;
- }
- else if (event == ENC_START_FILE)
- {
+
+ break;
+
+ case ENC_START_FILE:
if (on_start_file((struct enc_file_event_data *)data))
return;
- }
- else if (event == ENC_END_FILE)
- {
+
+ break;
+
+ case ENC_END_FILE:
if (on_end_file((struct enc_file_event_data *)data))
return;
- }
- else if (event == ENC_REC_NEW_STREAM)
- {
+
+ break;
+
+ case ENC_REC_NEW_STREAM:
on_rec_new_stream((struct enc_buffer_event_data *)data);
return;
- }
- else
- {
+
+ default:
return;
}
+ /* Something failed above. Signal error back to core. */
((struct enc_file_event_data *)data)->chunk->flags |= CHUNKF_ERROR;
} /* enc_events_callback */