Added a sinewave audio test source
- Added a test audio sinewave test source that should just play a sine wave of the middle C note. Using unsigned 8 bit mono to test ffmpeg's audio resampler, seems to work pretty good. - Fixed a boolean trap in threading.h for the event_init function, it now uses enum event_type, which can be EVENT_TYPE_MANUAL or EVENT_TYPE_AUTO, to specify whether the event is automatically reset or not. - Changed display names of test sources to something a little less vague. - Removed te whole "if timestamp is 0 just use current system time" when outputting source audio, if you want to use system time you should just use system time yourself. Using 0 as some sort of "indicator" like that just makes things confusing, and prevents you from legitimately using 0 as a timestamp for your audio data.
This commit is contained in:
@@ -53,9 +53,14 @@ struct event_data {
|
||||
bool manual;
|
||||
};
|
||||
|
||||
enum event_type {
|
||||
EVENT_TYPE_AUTO,
|
||||
EVENT_TYPE_MANUAL
|
||||
};
|
||||
|
||||
typedef struct event_data event_t;
|
||||
|
||||
static inline int event_init(event_t *event, bool manual)
|
||||
static inline int event_init(event_t *event, enum event_type type)
|
||||
{
|
||||
int code = 0;
|
||||
|
||||
@@ -65,7 +70,7 @@ static inline int event_init(event_t *event, bool manual)
|
||||
if ((code = pthread_cond_init(&event->cond, NULL)) < 0)
|
||||
pthread_mutex_destroy(&event->mutex);
|
||||
|
||||
event->manual = manual;
|
||||
event->manual = (type == EVENT_TYPE_MANUAL);
|
||||
event->signalled = false;
|
||||
|
||||
return code;
|
||||
|
Reference in New Issue
Block a user