summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/playback.c2
-rw-r--r--apps/recorder/pcm_record.c44
-rw-r--r--apps/recorder/recording.c14
-rw-r--r--firmware/export/audio.h22
-rw-r--r--firmware/export/enc_base.h4
-rw-r--r--lib/rbcodec/codecs/codecs.h10
-rw-r--r--lib/rbcodec/codecs/mp3_enc.c52
-rw-r--r--lib/rbcodec/codecs/wav_enc.c4
-rw-r--r--lib/rbcodec/codecs/wavpack_enc.c8
9 files changed, 80 insertions, 80 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 5e3e4d008d..f676c6d31f 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -787,7 +787,7 @@ static void audio_reset_buffer_noalloc(
787 allocsize = ALIGN_UP(allocsize, sizeof (intptr_t)); 787 allocsize = ALIGN_UP(allocsize, sizeof (intptr_t));
788 if (allocsize > filebuflen) 788 if (allocsize > filebuflen)
789 goto bufpanic; 789 goto bufpanic;
790 790
791 filebuflen -= allocsize; 791 filebuflen -= allocsize;
792 792
793 /* Scratch memory */ 793 /* Scratch memory */
diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c
index 3b3211afab..6b9adda8bd 100644
--- a/apps/recorder/pcm_record.c
+++ b/apps/recorder/pcm_record.c
@@ -99,7 +99,7 @@ static int num_channels; /* Current number of channels */
99static int rec_mono_mode; /* how mono is created */ 99static int rec_mono_mode; /* how mono is created */
100static struct encoder_config enc_config; /* Current encoder configuration */ 100static struct encoder_config enc_config; /* Current encoder configuration */
101static unsigned long pre_record_ticks; /* pre-record time in ticks */ 101static unsigned long pre_record_ticks; /* pre-record time in ticks */
102 102
103/**************************************************************************** 103/****************************************************************************
104 use 2 circular buffers: 104 use 2 circular buffers:
105 pcm_buffer=DMA output buffer: chunks (8192 Bytes) of raw pcm audio data 105 pcm_buffer=DMA output buffer: chunks (8192 Bytes) of raw pcm audio data
@@ -166,7 +166,7 @@ static size_t enc_chunk_size; /* maximum encoder chunk size */
166static unsigned long enc_sample_rate; /* sample rate used by encoder */ 166static unsigned long enc_sample_rate; /* sample rate used by encoder */
167static bool pcmrec_context = false; /* called by pcmrec thread? */ 167static bool pcmrec_context = false; /* called by pcmrec thread? */
168static bool pcm_buffer_empty; /* all pcm chunks processed? */ 168static bool pcm_buffer_empty; /* all pcm chunks processed? */
169 169
170/** file flushing **/ 170/** file flushing **/
171static int low_watermark; /* Low watermark to stop flush */ 171static int low_watermark; /* Low watermark to stop flush */
172static int high_watermark; /* max chunk limit for data flush */ 172static int high_watermark; /* max chunk limit for data flush */
@@ -259,7 +259,7 @@ static void pcmrec_raise_warning_status(unsigned long w)
259{ 259{
260 warnings |= w; 260 warnings |= w;
261} 261}
262 262
263/* Callback for when more data is ready - called in interrupt context */ 263/* Callback for when more data is ready - called in interrupt context */
264static void pcm_rec_have_more(void **start, size_t *size) 264static void pcm_rec_have_more(void **start, size_t *size)
265{ 265{
@@ -457,7 +457,7 @@ void audio_pause_recording(void)
457 457
458/** 458/**
459 * Resume current recording if paused 459 * Resume current recording if paused
460 */ 460 */
461void audio_resume_recording(void) 461void audio_resume_recording(void)
462{ 462{
463 logf("audio_resume_recording"); 463 logf("audio_resume_recording");
@@ -466,11 +466,11 @@ void audio_resume_recording(void)
466} /* audio_resume_recording */ 466} /* audio_resume_recording */
467 467
468/** 468/**
469 * Note that microphone is mono, only left value is used 469 * Note that microphone is mono, only left value is used
470 * See audiohw_set_recvol() for exact ranges. 470 * See audiohw_set_recvol() for exact ranges.
471 * 471 *
472 * @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN 472 * @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN
473 * 473 *
474 */ 474 */
475void audio_set_recording_gain(int left, int right, int type) 475void audio_set_recording_gain(int left, int right, int type)
476{ 476{
@@ -503,7 +503,7 @@ unsigned long audio_num_recorded_bytes(void)
503 503
504 return num_rec_bytes; 504 return num_rec_bytes;
505} /* audio_num_recorded_bytes */ 505} /* audio_num_recorded_bytes */
506 506
507/***************************************************************************/ 507/***************************************************************************/
508/* */ 508/* */
509/* Functions that execute in the context of audio thread */ 509/* Functions that execute in the context of audio thread */
@@ -559,14 +559,14 @@ static inline void pcmrec_fnq_set_empty(void)
559{ 559{
560 fnq_rd_pos = fnq_wr_pos; 560 fnq_rd_pos = fnq_wr_pos;
561} /* pcmrec_fnq_set_empty */ 561} /* pcmrec_fnq_set_empty */
562 562
563/* returns true if the queue is full */ 563/* returns true if the queue is full */
564static bool pcmrec_fnq_is_full(void) 564static bool pcmrec_fnq_is_full(void)
565{ 565{
566 ssize_t size = fnq_wr_pos - fnq_rd_pos; 566 ssize_t size = fnq_wr_pos - fnq_rd_pos;
567 if (size < 0) 567 if (size < 0)
568 size += fnq_size; 568 size += fnq_size;
569 569
570 return size >= fnq_size - MAX_PATH; 570 return size >= fnq_size - MAX_PATH;
571} /* pcmrec_fnq_is_full */ 571} /* pcmrec_fnq_is_full */
572 572
@@ -575,7 +575,7 @@ static bool pcmrec_fnq_add_filename(const char *filename)
575{ 575{
576 strlcpy(fn_queue + fnq_wr_pos, filename, MAX_PATH); 576 strlcpy(fn_queue + fnq_wr_pos, filename, MAX_PATH);
577 fnq_wr_pos = FNQ_NEXT(fnq_wr_pos); 577 fnq_wr_pos = FNQ_NEXT(fnq_wr_pos);
578 578
579 if (fnq_rd_pos != fnq_wr_pos) 579 if (fnq_rd_pos != fnq_wr_pos)
580 return true; 580 return true;
581 581
@@ -607,7 +607,7 @@ static bool pcmrec_fnq_get_filename(char *filename)
607 607
608 if (filename) 608 if (filename)
609 strlcpy(filename, fn_queue + fnq_rd_pos, MAX_PATH); 609 strlcpy(filename, fn_queue + fnq_rd_pos, MAX_PATH);
610 610
611 fnq_rd_pos = FNQ_NEXT(fnq_rd_pos); 611 fnq_rd_pos = FNQ_NEXT(fnq_rd_pos);
612 return true; 612 return true;
613} /* pcmrec_fnq_get_filename */ 613} /* pcmrec_fnq_get_filename */
@@ -683,7 +683,7 @@ static void pcmrec_start_file(void)
683 logf("start file: file already open"); 683 logf("start file: file already open");
684 pcmrec_raise_error_status(PCMREC_E_FNQ_DESYNC); 684 pcmrec_raise_error_status(PCMREC_E_FNQ_DESYNC);
685 } 685 }
686 686
687 if (errors != 0) 687 if (errors != 0)
688 rec_fdata.chunk->flags |= CHUNKF_ERROR; 688 rec_fdata.chunk->flags |= CHUNKF_ERROR;
689 689
@@ -709,7 +709,7 @@ static void pcmrec_start_file(void)
709 { 709 {
710 pcmrec_update_sizes(enc_size, num_pcm); 710 pcmrec_update_sizes(enc_size, num_pcm);
711 } 711 }
712 712
713 rec_fdata.chunk->flags &= ~CHUNKF_START_FILE; 713 rec_fdata.chunk->flags &= ~CHUNKF_START_FILE;
714} /* pcmrec_start_file */ 714} /* pcmrec_start_file */
715 715
@@ -893,7 +893,7 @@ static void pcmrec_flush(unsigned flush_num)
893 logf("writing:%d(%d):%s%s", num_ready, flush_num, 893 logf("writing:%d(%d):%s%s", num_ready, flush_num,
894 interruptable ? "i" : "", 894 interruptable ? "i" : "",
895 flush_num == PCMREC_FLUSH_MINI ? "m" : ""); 895 flush_num == PCMREC_FLUSH_MINI ? "m" : "");
896 896
897 cpu_boost(true); 897 cpu_boost(true);
898 898
899 remaining = flush_num; 899 remaining = flush_num;
@@ -1077,7 +1077,7 @@ static void pcmrec_new_stream(const char *filename, /* next file name */
1077 logf("stream prerecord start"); 1077 logf("stream prerecord start");
1078 start = data.pre_chunk = GET_ENC_CHUNK(pre_index); 1078 start = data.pre_chunk = GET_ENC_CHUNK(pre_index);
1079 start->flags &= CHUNKF_START_FILE | CHUNKF_PRERECORD; 1079 start->flags &= CHUNKF_START_FILE | CHUNKF_PRERECORD;
1080 } 1080 }
1081 else 1081 else
1082 { 1082 {
1083 logf("stream normal start"); 1083 logf("stream normal start");
@@ -1145,7 +1145,7 @@ static void pcmrec_new_stream(const char *filename, /* next file name */
1145 pcmrec_flush(PCMREC_FLUSH_ALL); 1145 pcmrec_flush(PCMREC_FLUSH_ALL);
1146 did_flush = true; 1146 did_flush = true;
1147 } 1147 }
1148 1148
1149 fnq_add_fn(path); 1149 fnq_add_fn(path);
1150 } 1150 }
1151 1151
@@ -1271,7 +1271,7 @@ static void pcmrec_record(const char *filename)
1271 num_rec_bytes = 0; 1271 num_rec_bytes = 0;
1272 num_rec_samples = 0; 1272 num_rec_samples = 0;
1273 1273
1274 if (!is_recording) 1274 if (!is_recording)
1275 { 1275 {
1276#if 0 1276#if 0
1277 accum_rec_bytes = 0; 1277 accum_rec_bytes = 0;
@@ -1371,7 +1371,7 @@ static void pcmrec_record(const char *filename)
1371static void pcmrec_stop(void) 1371static void pcmrec_stop(void)
1372{ 1372{
1373 logf("pcmrec_stop"); 1373 logf("pcmrec_stop");
1374 1374
1375 if (is_recording) 1375 if (is_recording)
1376 { 1376 {
1377 dma_lock = true; /* lock dma write position */ 1377 dma_lock = true; /* lock dma write position */
@@ -1401,7 +1401,7 @@ static void pcmrec_stop(void)
1401 { 1401 {
1402 logf("fnq: not empty!"); 1402 logf("fnq: not empty!");
1403 pcmrec_fnq_set_empty(); 1403 pcmrec_fnq_set_empty();
1404 } 1404 }
1405 1405
1406 /* be absolutely sure the file is closed */ 1406 /* be absolutely sure the file is closed */
1407 if (errors != 0) 1407 if (errors != 0)
@@ -1446,7 +1446,7 @@ static void pcmrec_pause(void)
1446static void pcmrec_resume(void) 1446static void pcmrec_resume(void)
1447{ 1447{
1448 logf("pcmrec_resume"); 1448 logf("pcmrec_resume");
1449 1449
1450 if (!is_recording) 1450 if (!is_recording)
1451 { 1451 {
1452 logf("not recording"); 1452 logf("not recording");
@@ -1593,7 +1593,7 @@ void enc_set_parameters(struct enc_parameters *params)
1593 1593
1594 enc_num_chunks = bufsize / enc_chunk_size; 1594 enc_num_chunks = bufsize / enc_chunk_size;
1595 logf("num chunks:%d", enc_num_chunks); 1595 logf("num chunks:%d", enc_num_chunks);
1596 1596
1597 /* get real amount used by encoder chunks */ 1597 /* get real amount used by encoder chunks */
1598 bufsize = enc_num_chunks*enc_chunk_size; 1598 bufsize = enc_num_chunks*enc_chunk_size;
1599 logf("enc size:%lu", bufsize); 1599 logf("enc size:%lu", bufsize);
@@ -1674,7 +1674,7 @@ struct enc_chunk_hdr * enc_get_chunk(void)
1674 return chunk; 1674 return chunk;
1675} /* enc_get_chunk */ 1675} /* enc_get_chunk */
1676 1676
1677/* releases the current chunk into the available chunks - 1677/* releases the current chunk into the available chunks -
1678 NOTE: can be called by pcmrec thread when splitting streams */ 1678 NOTE: can be called by pcmrec thread when splitting streams */
1679void enc_finish_chunk(void) 1679void enc_finish_chunk(void)
1680{ 1680{
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 53dc5cbf95..4893f589f1 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -280,7 +280,7 @@ static void set_gain(void)
280 { 280 {
281 if (global_settings.rec_mic_gain > sound_max(SOUND_MIC_GAIN)) 281 if (global_settings.rec_mic_gain > sound_max(SOUND_MIC_GAIN))
282 global_settings.rec_mic_gain = sound_max(SOUND_MIC_GAIN); 282 global_settings.rec_mic_gain = sound_max(SOUND_MIC_GAIN);
283 283
284 if (global_settings.rec_mic_gain < sound_min(SOUND_MIC_GAIN)) 284 if (global_settings.rec_mic_gain < sound_min(SOUND_MIC_GAIN))
285 global_settings.rec_mic_gain = sound_min(SOUND_MIC_GAIN); 285 global_settings.rec_mic_gain = sound_min(SOUND_MIC_GAIN);
286 286
@@ -301,7 +301,7 @@ static void set_gain(void)
301 301
302 if (global_settings.rec_right_gain < sound_min(SOUND_RIGHT_GAIN)) 302 if (global_settings.rec_right_gain < sound_min(SOUND_RIGHT_GAIN))
303 global_settings.rec_right_gain = sound_min(SOUND_RIGHT_GAIN); 303 global_settings.rec_right_gain = sound_min(SOUND_RIGHT_GAIN);
304 304
305 /* AUDIO_SRC_LINEIN, AUDIO_SRC_FMRADIO, AUDIO_SRC_SPDIF */ 305 /* AUDIO_SRC_LINEIN, AUDIO_SRC_FMRADIO, AUDIO_SRC_SPDIF */
306 audio_set_recording_gain(global_settings.rec_left_gain, 306 audio_set_recording_gain(global_settings.rec_left_gain,
307 global_settings.rec_right_gain, 307 global_settings.rec_right_gain,
@@ -327,7 +327,7 @@ static bool read_peak_levels(int *peak_l, int *peak_r, int *balance)
327 return false; 327 return false;
328 328
329 if (*peak_r > *peak_l) 329 if (*peak_r > *peak_l)
330 balance_mem[peak_time % BAL_MEM_SIZE] = (*peak_l ? 330 balance_mem[peak_time % BAL_MEM_SIZE] = (*peak_l ?
331 MIN((10000 * *peak_r) / *peak_l - 10000, 15118) : 15118); 331 MIN((10000 * *peak_r) / *peak_l - 10000, 15118) : 15118);
332 else 332 else
333 balance_mem[peak_time % BAL_MEM_SIZE] = (*peak_r ? 333 balance_mem[peak_time % BAL_MEM_SIZE] = (*peak_r ?
@@ -394,7 +394,7 @@ static void change_recording_gain(bool increment, bool left, bool right)
394 } 394 }
395} 395}
396 396
397/* 397/*
398 * Handle automatic gain control (AGC). 398 * Handle automatic gain control (AGC).
399 * Change recording gain if peak_x levels are above or below 399 * Change recording gain if peak_x levels are above or below
400 * target volume for specified timeouts. 400 * target volume for specified timeouts.
@@ -645,7 +645,7 @@ int rec_create_directory(void)
645 { 645 {
646 while (action_userabort(HZ) == false) 646 while (action_userabort(HZ) == false)
647 { 647 {
648 splashf(0, "%s %s", 648 splashf(0, "%s %s",
649 str(LANG_REC_DIR_NOT_WRITABLE), 649 str(LANG_REC_DIR_NOT_WRITABLE),
650 str(LANG_OFF_ABORT)); 650 str(LANG_OFF_ABORT));
651 } 651 }
@@ -1050,7 +1050,7 @@ bool recording_screen(bool no_source)
1050 int trig_ypos[NB_SCREENS]; /* trigger bar y pos */ 1050 int trig_ypos[NB_SCREENS]; /* trigger bar y pos */
1051 int trig_width[NB_SCREENS]; /* trigger bar width */ 1051 int trig_width[NB_SCREENS]; /* trigger bar width */
1052 int top_height_req[NB_SCREENS]; /* required height for top half */ 1052 int top_height_req[NB_SCREENS]; /* required height for top half */
1053 /* tweak layout tiny screens / big fonts */ 1053 /* tweak layout tiny screens / big fonts */
1054 bool compact_view[NB_SCREENS] = { false }; 1054 bool compact_view[NB_SCREENS] = { false };
1055 struct gui_synclist lists; /* the list in the bottom vp */ 1055 struct gui_synclist lists; /* the list in the bottom vp */
1056#if defined(HAVE_AGC) 1056#if defined(HAVE_AGC)
@@ -1445,7 +1445,7 @@ bool recording_screen(bool no_source)
1445#ifdef HAVE_MIC_REC 1445#ifdef HAVE_MIC_REC
1446 if(global_settings.rec_source == AUDIO_SRC_MIC) 1446 if(global_settings.rec_source == AUDIO_SRC_MIC)
1447 { 1447 {
1448 global_settings.rec_mic_gain -= 1448 global_settings.rec_mic_gain -=
1449 sound_steps(SOUND_MIC_GAIN); 1449 sound_steps(SOUND_MIC_GAIN);
1450 } 1450 }
1451 else 1451 else
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index 5309ddd1d1..293956cb37 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -77,7 +77,7 @@ void audio_beep(int duration);
77 77
78/* Required call when audio buffer is required for some other purpose */ 78/* Required call when audio buffer is required for some other purpose */
79/* implemented in apps but called from firmware(!) */ 79/* implemented in apps but called from firmware(!) */
80unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size); 80unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size);
81 81
82#if CONFIG_CODEC == SWCODEC 82#if CONFIG_CODEC == SWCODEC
83void audio_next_dir(void); 83void audio_next_dir(void);
@@ -257,29 +257,29 @@ void audio_register_event_handler(AUDIO_EVENT_HANDLER handler, unsigned short ma
257/***********************************************************************/ 257/***********************************************************************/
258/* handler return codes */ 258/* handler return codes */
259 259
260#define AUDIO_EVENT_RC_IGNORED 200 260#define AUDIO_EVENT_RC_IGNORED 200
261 /* indicates that no action was taken or the event was not recognized */ 261 /* indicates that no action was taken or the event was not recognized */
262 262
263#define AUDIO_EVENT_RC_HANDLED 201 263#define AUDIO_EVENT_RC_HANDLED 201
264 /* indicates that the event was handled and some action was taken which renders 264 /* indicates that the event was handled and some action was taken which renders
265 the original event invalid; USE WITH CARE!; this return code aborts all further 265 the original event invalid; USE WITH CARE!; this return code aborts all further
266 processing of the given event */ 266 processing of the given event */
267 267
268/***********************************************************************/ 268/***********************************************************************/
269/* audio event IDs */ 269/* audio event IDs */
270 270
271#define AUDIO_EVENT_POS_REPORT (1<<0) 271#define AUDIO_EVENT_POS_REPORT (1<<0)
272 /* sends a periodic song position report to handlers; a report is sent on 272 /* sends a periodic song position report to handlers; a report is sent on
273 each kernal tick; the number of ticks per second is defined by HZ; on each 273 each kernal tick; the number of ticks per second is defined by HZ; on each
274 report the current song position is passed in 'data'; if a handler takes an 274 report the current song position is passed in 'data'; if a handler takes an
275 action that changes the song or the song position it must return 275 action that changes the song or the song position it must return
276 AUDIO_EVENT_RC_HANDLED which suppresses the event for any remaining handlers */ 276 AUDIO_EVENT_RC_HANDLED which suppresses the event for any remaining handlers */
277 277
278#define AUDIO_EVENT_END_OF_TRACK (1<<1) 278#define AUDIO_EVENT_END_OF_TRACK (1<<1)
279 /* generated when the end of the currently playing track is reached; no 279 /* generated when the end of the currently playing track is reached; no
280 data is passed; if the handler implements some alternate end-of-track 280 data is passed; if the handler implements some alternate end-of-track
281 processing it should return AUDIO_EVENT_RC_HANDLED which suppresses the 281 processing it should return AUDIO_EVENT_RC_HANDLED which suppresses the
282 event for any remaining handlers as well as the normal end-of-track 282 event for any remaining handlers as well as the normal end-of-track
283 processing */ 283 processing */
284 284
285#endif 285#endif
diff --git a/firmware/export/enc_base.h b/firmware/export/enc_base.h
index c2fbe26d6c..f5dfb65f2a 100644
--- a/firmware/export/enc_base.h
+++ b/firmware/export/enc_base.h
@@ -145,7 +145,7 @@ struct encoder_config
145 struct mp3_enc_config mp3_enc; 145 struct mp3_enc_config mp3_enc;
146 struct wavpack_enc_config wavpack_enc; 146 struct wavpack_enc_config wavpack_enc;
147 struct wav_enc_config wav_enc; 147 struct wav_enc_config wav_enc;
148 }; 148 };
149}; 149};
150 150
151/** Encoder chunk macros and definitions **/ 151/** Encoder chunk macros and definitions **/
@@ -218,7 +218,7 @@ struct enc_file_event_data
218 unsigned long new_num_pcm; /* New number of pcm in chunk */ 218 unsigned long new_num_pcm; /* New number of pcm in chunk */
219 const char *filename; /* filename to open if ENC_START_FILE */ 219 const char *filename; /* filename to open if ENC_START_FILE */
220 int rec_file; /* Current file or < 0 if none */ 220 int rec_file; /* Current file or < 0 if none */
221 unsigned long num_pcm_samples; /* Current pcm sample count written to 221 unsigned long num_pcm_samples; /* Current pcm sample count written to
222 file so far. */ 222 file so far. */
223}; 223};
224 224
diff --git a/lib/rbcodec/codecs/codecs.h b/lib/rbcodec/codecs/codecs.h
index 03167f55bf..ae4233b7a6 100644
--- a/lib/rbcodec/codecs/codecs.h
+++ b/lib/rbcodec/codecs/codecs.h
@@ -107,13 +107,13 @@ enum codec_command_action {
107struct codec_api { 107struct codec_api {
108 off_t filesize; /* Total file length */ 108 off_t filesize; /* Total file length */
109 off_t curpos; /* Current buffer position */ 109 off_t curpos; /* Current buffer position */
110 110
111 struct mp3entry *id3; /* TAG metadata pointer */ 111 struct mp3entry *id3; /* TAG metadata pointer */
112 int audio_hid; /* Current audio handle */ 112 int audio_hid; /* Current audio handle */
113 113
114 /* The dsp instance to be used for audio output */ 114 /* The dsp instance to be used for audio output */
115 struct dsp_config *dsp; 115 struct dsp_config *dsp;
116 116
117 /* Returns buffer to malloc array. Only codeclib should need this. */ 117 /* Returns buffer to malloc array. Only codeclib should need this. */
118 void* (*codec_get_buffer)(size_t *size); 118 void* (*codec_get_buffer)(size_t *size);
119 /* Insert PCM data into audio buffer for playback. Playback will start 119 /* Insert PCM data into audio buffer for playback. Playback will start
@@ -121,7 +121,7 @@ struct codec_api {
121 void (*pcmbuf_insert)(const void *ch1, const void *ch2, int count); 121 void (*pcmbuf_insert)(const void *ch1, const void *ch2, int count);
122 /* Set song position in WPS (value in ms). */ 122 /* Set song position in WPS (value in ms). */
123 void (*set_elapsed)(unsigned long value); 123 void (*set_elapsed)(unsigned long value);
124 124
125 /* Read next <size> amount bytes from file buffer to <ptr>. 125 /* Read next <size> amount bytes from file buffer to <ptr>.
126 Will return number of bytes read or 0 if end of file. */ 126 Will return number of bytes read or 0 if end of file. */
127 size_t (*read_filebuf)(void *ptr, size_t size); 127 size_t (*read_filebuf)(void *ptr, size_t size);
@@ -198,7 +198,7 @@ struct codec_api {
198 void (*profile_func_enter)(void *this_fn, void *call_site); 198 void (*profile_func_enter)(void *this_fn, void *call_site);
199 void (*profile_func_exit)(void *this_fn, void *call_site); 199 void (*profile_func_exit)(void *this_fn, void *call_site);
200#endif 200#endif
201 201
202#ifdef HAVE_RECORDING 202#ifdef HAVE_RECORDING
203 void (*enc_get_inputs)(struct enc_inputs *inputs); 203 void (*enc_get_inputs)(struct enc_inputs *inputs);
204 void (*enc_set_parameters)(struct enc_parameters *params); 204 void (*enc_set_parameters)(struct enc_parameters *params);
diff --git a/lib/rbcodec/codecs/mp3_enc.c b/lib/rbcodec/codecs/mp3_enc.c
index e66ee1d910..000eedd849 100644
--- a/lib/rbcodec/codecs/mp3_enc.c
+++ b/lib/rbcodec/codecs/mp3_enc.c
@@ -185,7 +185,7 @@ static const uint8_t ht_count_const[2][2][16] =
185 { {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */ 185 { {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */
186 { 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */ 186 { 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */
187 187
188static const uint8_t t1HB_const[4] = {1,1,1,0}; 188static const uint8_t t1HB_const[4] = {1,1,1,0};
189static const uint8_t t2HB_const[9] = {1,2,1,3,1,1,3,2,0}; 189static const uint8_t t2HB_const[9] = {1,2,1,3,1,1,3,2,0};
190static const uint8_t t3HB_const[9] = {3,2,1,1,1,1,3,2,0}; 190static const uint8_t t3HB_const[9] = {3,2,1,1,1,1,3,2,0};
191static const uint8_t t5HB_const[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0}; 191static const uint8_t t5HB_const[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0};
@@ -739,11 +739,11 @@ static const short int2idx_const[4096] = /* int2idx[i] = sqrt(i*sqrt(i)); */
739509,509,509,509,509,509,509,509,509,509,510,510,510,510,510,510,510,510,510,510, 739509,509,509,509,509,509,509,509,509,509,510,510,510,510,510,510,510,510,510,510,
740510,511,511,511,511,511,511,511,511,511,511,512,512,512,512,512 }; 740510,511,511,511,511,511,511,511,511,511,511,512,512,512,512,512 };
741 741
742static const int order[32] = 742static const int order[32] =
743{ 0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29, 743{ 0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29,
744 2, 3, 18, 19,10,11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31 }; 744 2, 3, 18, 19,10,11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31 };
745 745
746static const long sampr_index[2][3] = 746static const long sampr_index[2][3] =
747{ { 22050, 24000, 16000 }, /* MPEG 2 */ 747{ { 22050, 24000, 16000 }, /* MPEG 2 */
748 { 44100, 48000, 32000 } }; /* MPEG 1 */ 748 { 44100, 48000, 32000 } }; /* MPEG 1 */
749 749
@@ -765,7 +765,7 @@ static const int ca_const[8] =
765static const int cs_const[8] = 765static const int cs_const[8] =
766{ 28098, 28893, 31117, 32221, 32621, 32740, 32765, 32768 }; 766{ 28098, 28893, 31117, 32221, 32621, 32740, 32765, 32768 };
767 767
768static const short enwindow_const[15*27+24] = 768static const short enwindow_const[15*27+24] =
769{ 0, 65, 593, 1766, 22228, 2115, 611, 62, 769{ 0, 65, 593, 1766, 22228, 2115, 611, 62,
770 8, 119, 1419, 10564,-11659,-1635,-154, -9, 770 8, 119, 1419, 10564,-11659,-1635,-154, -9,
771 -8, -119,-1419,-10564, 11659, 1635, 154, 9, 464, 100, 91, 771 -8, -119,-1419,-10564, 11659, 1635, 154, 9, 464, 100, 91,
@@ -853,7 +853,7 @@ static void encodeSideInfo( side_info_t si[2][2] )
853{ 853{
854 int gr, ch, header; 854 int gr, ch, header;
855 uint32_t cc=0, sz=0; 855 uint32_t cc=0, sz=0;
856 856
857 /* 857 /*
858 * MPEG header layout: 858 * MPEG header layout:
859 * AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM 859 * AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM
@@ -960,7 +960,7 @@ static void Huffmancodebits( short *ix, char *xr_sign, side_info_t *gi )
960 960
961 if(bigvals > region2) 961 if(bigvals > region2)
962 bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]); 962 bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]);
963 963
964 if(count1 > bigvals) 964 if(count1 > bigvals)
965 bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]); 965 bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]);
966 966
@@ -1158,7 +1158,7 @@ static int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits )
1158{ 1158{
1159 uint32_t i; 1159 uint32_t i;
1160 int max, table0, table1; 1160 int max, table0, table1;
1161 1161
1162 for(i=begin,max=0; i<end; i++) 1162 for(i=begin,max=0; i<end; i++)
1163 if(ix[i] > max) 1163 if(ix[i] > max)
1164 max = ix[i]; 1164 max = ix[i];
@@ -1315,7 +1315,7 @@ static int calc_runlen( short *ix, side_info_t *si )
1315 int w = ix[i-2]; 1315 int w = ix[i-2];
1316 int x = ix[i-3]; 1316 int x = ix[i-3];
1317 int y = ix[i-4]; 1317 int y = ix[i-4];
1318 1318
1319 if((v | w | x | y) <= 1) 1319 if((v | w | x | y) <= 1)
1320 { 1320 {
1321 p = (y<<3) + (x<<2) + (w<<1) + (v); 1321 p = (y<<3) + (x<<2) + (w<<1) + (v);
@@ -1380,7 +1380,7 @@ static int quantize_int(int *xr, short *ix, side_info_t *si)
1380static void subdivide(side_info_t *si) 1380static void subdivide(side_info_t *si)
1381{ 1381{
1382 int scfb, count0, count1; 1382 int scfb, count0, count1;
1383 1383
1384 if( !si->address3 ) 1384 if( !si->address3 )
1385 { /* no bigvalue region */ 1385 { /* no bigvalue region */
1386 si->region_0_1 = 0; 1386 si->region_0_1 = 0;
@@ -1442,7 +1442,7 @@ static int quantize_and_count_bits(int *xr, short *ix, side_info_t *si)
1442 1442
1443/************************************************************************/ 1443/************************************************************************/
1444/* The code selects the best quantStep for a particular set of scalefacs*/ 1444/* The code selects the best quantStep for a particular set of scalefacs*/
1445/************************************************************************/ 1445/************************************************************************/
1446static int inner_loop(int *xr, int max_bits, side_info_t *si) 1446static int inner_loop(int *xr, int max_bits, side_info_t *si)
1447{ 1447{
1448 int bits; 1448 int bits;
@@ -1783,7 +1783,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
1783 a[ 7] -= a[ 6]; 1783 a[ 7] -= a[ 6];
1784 a[22] -= a[ 7]; 1784 a[22] -= a[ 7];
1785 a[23] -= a[22]; 1785 a[23] -= a[22];
1786 1786
1787 xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr; 1787 xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr;
1788 xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr; 1788 xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr;
1789 xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr; 1789 xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr;
@@ -1803,23 +1803,23 @@ void window_subband2(short *x1, int a[SBLIMIT])
1803 xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25]; 1803 xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25];
1804 xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25]; 1804 xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25];
1805 xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25]; 1805 xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25];
1806 1806
1807 xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr; 1807 xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr;
1808 xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr; 1808 xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr;
1809 xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18]; 1809 xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18];
1810 xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19]; 1810 xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19];
1811 1811
1812 xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr; 1812 xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr;
1813 xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr; 1813 xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr;
1814 xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr; 1814 xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr;
1815 1815
1816 xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr; 1816 xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr;
1817 xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr; 1817 xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr;
1818 xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr; 1818 xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr;
1819 xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr; 1819 xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr;
1820 1820
1821 xr = a[27]; a[27] = a[6] - xr; a[6] += xr; 1821 xr = a[27]; a[27] = a[6] - xr; a[6] += xr;
1822 1822
1823 xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr; 1823 xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr;
1824 xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr; 1824 xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr;
1825 xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr; 1825 xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr;
@@ -1828,15 +1828,15 @@ void window_subband2(short *x1, int a[SBLIMIT])
1828 xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9]; 1828 xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9];
1829 xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25]; 1829 xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25];
1830 xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24]; 1830 xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24];
1831 1831
1832 xr = a[24] - a[16]; a[24] = xr; 1832 xr = a[24] - a[16]; a[24] = xr;
1833 xr = a[20] - xr; a[20] = xr; 1833 xr = a[20] - xr; a[20] = xr;
1834 xr = a[28] - xr; a[28] = xr; 1834 xr = a[28] - xr; a[28] = xr;
1835 1835
1836 xr = a[25] - a[17]; a[25] = xr; 1836 xr = a[25] - a[17]; a[25] = xr;
1837 xr = a[21] - xr; a[21] = xr; 1837 xr = a[21] - xr; a[21] = xr;
1838 xr = a[29] - xr; a[29] = xr; 1838 xr = a[29] - xr; a[29] = xr;
1839 1839
1840 xr = a[17] - a[1]; a[17] = xr; 1840 xr = a[17] - a[1]; a[17] = xr;
1841 xr = a[ 9] - xr; a[ 9] = xr; 1841 xr = a[ 9] - xr; a[ 9] = xr;
1842 xr = a[25] - xr; a[25] = xr; 1842 xr = a[25] - xr; a[25] = xr;
@@ -1844,7 +1844,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
1844 xr = a[21] - xr; a[21] = xr; 1844 xr = a[21] - xr; a[21] = xr;
1845 xr = a[13] - xr; a[13] = xr; 1845 xr = a[13] - xr; a[13] = xr;
1846 xr = a[29] - xr; a[29] = xr; 1846 xr = a[29] - xr; a[29] = xr;
1847 1847
1848 xr = a[ 1] - a[0]; a[ 1] = xr; 1848 xr = a[ 1] - a[0]; a[ 1] = xr;
1849 xr = a[16] - xr; a[16] = xr; 1849 xr = a[16] - xr; a[16] = xr;
1850 xr = a[17] - xr; a[17] = xr; 1850 xr = a[17] - xr; a[17] = xr;
@@ -1860,7 +1860,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
1860 xr = a[13] - xr; a[13] = xr; 1860 xr = a[13] - xr; a[13] = xr;
1861 xr = a[28] - xr; a[28] = xr; 1861 xr = a[28] - xr; a[28] = xr;
1862 xr = a[29] - xr; a[29] = xr; 1862 xr = a[29] - xr; a[29] = xr;
1863 1863
1864 xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr; 1864 xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr;
1865 xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr; 1865 xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr;
1866 xr = a[16]; a[16] += a[15]; a[15] -= xr; 1866 xr = a[16]; a[16] += a[15]; a[15] -= xr;
@@ -1900,7 +1900,7 @@ void mdct_long(int *out, int *in)
1900 ct = (tc1 - tc3 - tc4) * cx[6]; 1900 ct = (tc1 - tc3 - tc4) * cx[6];
1901 out[5] = ct + st; 1901 out[5] = ct + st;
1902 out[6] = ct - st; 1902 out[6] = ct - st;
1903 1903
1904 tc2 = (in[16] - in[10]) * cx[6]; 1904 tc2 = (in[16] - in[10]) * cx[6];
1905 ts6 = ts6 * cx[7] + in[4] * cx[8]; 1905 ts6 = ts6 * cx[7] + in[4] * cx[8];
1906 1906
@@ -1908,12 +1908,12 @@ void mdct_long(int *out, int *in)
1908 st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3]; 1908 st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3];
1909 out[1] = ct + st; 1909 out[1] = ct + st;
1910 out[2] = ct - st; 1910 out[2] = ct - st;
1911 1911
1912 ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0]; 1912 ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0];
1913 st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4]; 1913 st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4];
1914 out[ 9] = ct + st; 1914 out[ 9] = ct + st;
1915 out[10] = ct - st; 1915 out[10] = ct - st;
1916 1916
1917 ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1]; 1917 ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1];
1918 st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5]; 1918 st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5];
1919 out[13] = ct + st; 1919 out[13] = ct + st;
@@ -1966,7 +1966,7 @@ static int find_samplerate_index(long freq, int *mp3_type)
1966 int mpeg = freq >= (32000+24000)/2 ? 1 : 0; 1966 int mpeg = freq >= (32000+24000)/2 ? 1 : 0;
1967 int i = ci->round_value_to_list32(freq, sampr_index[mpeg], 3, true); 1967 int i = ci->round_value_to_list32(freq, sampr_index[mpeg], 3, true);
1968 *mp3_type = mpeg; 1968 *mp3_type = mpeg;
1969 return i; 1969 return i;
1970} 1970}
1971 1971
1972static bool init_mp3_encoder_engine(int sample_rate, 1972static bool init_mp3_encoder_engine(int sample_rate,
@@ -2523,7 +2523,7 @@ static void enc_events_callback(enum enc_events event, void *data)
2523 return; 2523 return;
2524 2524
2525 break; 2525 break;
2526 2526
2527 case ENC_END_FILE: 2527 case ENC_END_FILE:
2528 if (on_end_file((struct enc_file_event_data *)data)) 2528 if (on_end_file((struct enc_file_event_data *)data))
2529 return; 2529 return;
diff --git a/lib/rbcodec/codecs/wav_enc.c b/lib/rbcodec/codecs/wav_enc.c
index 85b6f560e3..01d0f79bcf 100644
--- a/lib/rbcodec/codecs/wav_enc.c
+++ b/lib/rbcodec/codecs/wav_enc.c
@@ -40,7 +40,7 @@ struct riff_header
40 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */ 40 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */
41 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */ 41 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */
42 /* Not for audio_format=1 (PCM) */ 42 /* Not for audio_format=1 (PCM) */
43/* unsigned short extra_param_size; 24h - size of extra data */ 43/* unsigned short extra_param_size; 24h - size of extra data */
44/* unsigned char *extra_params; */ 44/* unsigned char *extra_params; */
45 /* data header */ 45 /* data header */
46 uint8_t data_id[4]; /* 24h - "data" */ 46 uint8_t data_id[4]; /* 24h - "data" */
@@ -68,7 +68,7 @@ static const struct riff_header riff_header =
68 /* "RIFF" header */ 68 /* "RIFF" header */
69 { 'R', 'I', 'F', 'F' }, /* riff_id */ 69 { 'R', 'I', 'F', 'F' }, /* riff_id */
70 0, /* riff_size (*) */ 70 0, /* riff_size (*) */
71 /* format header */ 71 /* format header */
72 { 'W', 'A', 'V', 'E' }, /* format */ 72 { 'W', 'A', 'V', 'E' }, /* format */
73 { 'f', 'm', 't', ' ' }, /* format_id */ 73 { 'f', 'm', 't', ' ' }, /* format_id */
74 htole32(16), /* format_size */ 74 htole32(16), /* format_size */
diff --git a/lib/rbcodec/codecs/wavpack_enc.c b/lib/rbcodec/codecs/wavpack_enc.c
index 71454fff7d..1fae2d46a7 100644
--- a/lib/rbcodec/codecs/wavpack_enc.c
+++ b/lib/rbcodec/codecs/wavpack_enc.c
@@ -47,7 +47,7 @@ struct riff_header
47 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */ 47 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */
48 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */ 48 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */
49 /* Not for audio_format=1 (PCM) */ 49 /* Not for audio_format=1 (PCM) */
50/* unsigned short extra_param_size; 24h - size of extra data */ 50/* unsigned short extra_param_size; 24h - size of extra data */
51/* unsigned char *extra_params; */ 51/* unsigned char *extra_params; */
52 /* data header */ 52 /* data header */
53 uint8_t data_id[4]; /* 24h - "data" */ 53 uint8_t data_id[4]; /* 24h - "data" */
@@ -82,7 +82,7 @@ static const struct riff_header riff_header =
82 /* "RIFF" header */ 82 /* "RIFF" header */
83 { 'R', 'I', 'F', 'F' }, /* riff_id */ 83 { 'R', 'I', 'F', 'F' }, /* riff_id */
84 0, /* riff_size (*) */ 84 0, /* riff_size (*) */
85 /* format header */ 85 /* format header */
86 { 'W', 'A', 'V', 'E' }, /* format */ 86 { 'W', 'A', 'V', 'E' }, /* format */
87 { 'f', 'm', 't', ' ' }, /* format_id */ 87 { 'f', 'm', 't', ' ' }, /* format_id */
88 htole32(16), /* format_size */ 88 htole32(16), /* format_size */
@@ -234,7 +234,7 @@ static bool on_start_file(struct enc_file_event_data *data)
234 data->num_pcm_samples = 0; 234 data->num_pcm_samples = 0;
235 235
236 /* write template headers */ 236 /* write template headers */
237 if (ci->write(data->rec_file, &wvpk_mdh, sizeof (wvpk_mdh)) 237 if (ci->write(data->rec_file, &wvpk_mdh, sizeof (wvpk_mdh))
238 != sizeof (wvpk_mdh) || 238 != sizeof (wvpk_mdh) ||
239 ci->write(data->rec_file, &riff_header, sizeof (riff_header)) 239 ci->write(data->rec_file, &riff_header, sizeof (riff_header))
240 != sizeof (riff_header)) 240 != sizeof (riff_header))
@@ -344,7 +344,7 @@ static bool init_encoder(void)
344{ 344{
345 struct enc_inputs inputs; 345 struct enc_inputs inputs;
346 struct enc_parameters params; 346 struct enc_parameters params;
347 347
348 codec_init(); 348 codec_init();
349 349
350 if (ci->enc_get_inputs == NULL || 350 if (ci->enc_get_inputs == NULL ||