mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
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:
parent
0d01c4350b
commit
9a486efa5f
1 changed files with 35 additions and 24 deletions
|
|
@ -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[]) {
|
||||
|
|
@ -545,10 +548,11 @@ int main(int argc, char *argv[]) {
|
|||
{"channel-map", 1, NULL, ARG_CHANNELMAP},
|
||||
{"fix-format", 0, NULL, ARG_FIX_FORMAT},
|
||||
{"fix-rate", 0, NULL, ARG_FIX_RATE},
|
||||
{"fix-channels",0, NULL, ARG_FIX_CHANNELS},
|
||||
{"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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue