implement --process-time

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2293 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2008-04-22 02:38:51 +00:00
parent 0d01c4350b
commit 9a486efa5f

View file

@ -71,7 +71,7 @@ static int channel_map_set = 0;
static pa_stream_flags_t flags = 0;
static size_t latency = 0;
static size_t latency = 0, process_time=0;
/* A shortcut for terminating the application */
static void quit(int ret) {
@ -267,6 +267,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
if (latency > 0) {
memset(&buffer_attr, 0, sizeof(buffer_attr));
buffer_attr.tlength = latency;
buffer_attr.minreq = process_time;
flags |= PA_STREAM_ADJUST_LATENCY;
}
@ -502,6 +503,7 @@ static void help(const char *argv0) {
" --no-remix Don't upmix or downmix channels.\n"
" --no-remap Map channels by index instead of name.\n"
" --latency=BYTES Request the specified latency in bytes.\n"
" --process-time=BYTES Request the specified process time per request in bytes.\n"
,
argv0);
}
@ -519,7 +521,8 @@ enum {
ARG_FIX_CHANNELS,
ARG_NO_REMAP,
ARG_NO_REMIX,
ARG_LATENCY
ARG_LATENCY,
ARG_PROCESS_TIME
};
int main(int argc, char *argv[]) {
@ -548,7 +551,8 @@ int main(int argc, char *argv[]) {
{"fix-channels", 0, NULL, ARG_FIX_CHANNELS},
{"no-remap", 0, NULL, ARG_NO_REMAP},
{"no-remix", 0, NULL, ARG_NO_REMIX},
{"latency", 0, NULL, ARG_LATENCY},
{"latency", 1, NULL, ARG_LATENCY},
{"process-time", 1, NULL, ARG_PROCESS_TIME},
{NULL, 0, NULL, 0}
};
@ -656,7 +660,14 @@ int main(int argc, char *argv[]) {
case ARG_LATENCY:
if (((latency = atoi(optarg))) <= 0) {
fprintf(stderr, "Invallid latency specification '%s'\n", optarg);
fprintf(stderr, "Invalid latency specification '%s'\n", optarg);
goto quit;
}
break;
case ARG_PROCESS_TIME:
if (((process_time = atoi(optarg))) <= 0) {
fprintf(stderr, "Invalid process time specification '%s'\n", optarg);
goto quit;
}
break;