summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e5e59d2)
This assertion can be hit easily by choosing wav as the first filter
of the filter chain.
/* these do not need error handling (yet) */
#define SERVER_ERRORS
/* these do not need error handling (yet) */
#define SERVER_ERRORS
-#define WAV_FILTER_ERRORS
#define TIME_ERRORS
#define CLOSE_ON_FORK_ERRORS
#define DAEMON_ERRORS
#define TIME_ERRORS
#define CLOSE_ON_FORK_ERRORS
#define DAEMON_ERRORS
PARA_ERROR(COMPRESS_SYNTAX, "syntax error in compress filter config"), \
PARA_ERROR(COMPRESS_SYNTAX, "syntax error in compress filter config"), \
+#define WAV_FILTER_ERRORS \
+ PARA_ERROR(WAV_BAD_FC, "invalid filter chain configuration"), \
+
+
#define FEC_ERRORS \
PARA_ERROR(FEC_BAD_IDX, "invalid index vector"), \
PARA_ERROR(FEC_SINGULAR, "unexpected singular matrix"), \
#define FEC_ERRORS \
PARA_ERROR(FEC_BAD_IDX, "invalid index vector"), \
PARA_ERROR(FEC_SINGULAR, "unexpected singular matrix"), \
/** \file wav_filter.c A filter that inserts a wave header. */
#include "para.h"
/** \file wav_filter.c A filter that inserts a wave header. */
#include "para.h"
#include "list.h"
#include "sched.h"
#include "list.h"
#include "sched.h"
int bytespersec = channels * samplerate * BITS / 8;
int align = channels * BITS / 8;
int bytespersec = channels * samplerate * BITS / 8;
int align = channels * BITS / 8;
PARA_DEBUG_LOG("writing wave header: %d channels, %d KHz\n", channels, samplerate);
memset(headbuf, 0, WAV_HEADER_LEN);
memcpy(headbuf, "RIFF", 4);
PARA_DEBUG_LOG("writing wave header: %d channels, %d KHz\n", channels, samplerate);
memset(headbuf, 0, WAV_HEADER_LEN);
memcpy(headbuf, "RIFF", 4);
if (*bof) {
if (!len)
return 0;
if (*bof) {
if (!len)
return 0;
+ if (!fn->fc->channels || !fn->fc->samplerate) {
+ PARA_ERROR_LOG("%s\n", para_strerror(E_WAV_BAD_FC));
+ return -E_WAV_BAD_FC;
+ }
make_wav_header(fn->fc->channels, fn->fc->samplerate, fn);
fn->loaded = WAV_HEADER_LEN;
*bof = 0;
make_wav_header(fn->fc->channels, fn->fc->samplerate, fn);
fn->loaded = WAV_HEADER_LEN;
*bof = 0;