mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
examples: fix indent
This commit is contained in:
parent
7fc83ea417
commit
59756a7c5d
3 changed files with 35 additions and 35 deletions
|
|
@ -11,9 +11,9 @@ int main(int argc, char *argv[])
|
|||
pw_init(&argc, &argv);
|
||||
|
||||
fprintf(stdout, "Compiled with libpipewire %s\n"
|
||||
"Linked with libpipewire %s\n",
|
||||
pw_get_headers_version(),
|
||||
pw_get_library_version());
|
||||
"Linked with libpipewire %s\n",
|
||||
pw_get_headers_version(),
|
||||
pw_get_library_version());
|
||||
return 0;
|
||||
}
|
||||
/* [code] */
|
||||
|
|
|
|||
|
|
@ -20,37 +20,37 @@ static const struct pw_registry_events registry_events = {
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct pw_main_loop *loop;
|
||||
struct pw_context *context;
|
||||
struct pw_core *core;
|
||||
struct pw_registry *registry;
|
||||
struct spa_hook registry_listener;
|
||||
struct pw_main_loop *loop;
|
||||
struct pw_context *context;
|
||||
struct pw_core *core;
|
||||
struct pw_registry *registry;
|
||||
struct spa_hook registry_listener;
|
||||
|
||||
pw_init(&argc, &argv);
|
||||
pw_init(&argc, &argv);
|
||||
|
||||
loop = pw_main_loop_new(NULL /* properties */);
|
||||
context = pw_context_new(pw_main_loop_get_loop(loop),
|
||||
NULL /* properties */,
|
||||
0 /* user_data size */);
|
||||
loop = pw_main_loop_new(NULL /* properties */);
|
||||
context = pw_context_new(pw_main_loop_get_loop(loop),
|
||||
NULL /* properties */,
|
||||
0 /* user_data size */);
|
||||
|
||||
core = pw_context_connect(context,
|
||||
NULL /* properties */,
|
||||
0 /* user_data size */);
|
||||
core = pw_context_connect(context,
|
||||
NULL /* properties */,
|
||||
0 /* user_data size */);
|
||||
|
||||
registry = pw_core_get_registry(core, PW_VERSION_REGISTRY,
|
||||
0 /* user_data size */);
|
||||
registry = pw_core_get_registry(core, PW_VERSION_REGISTRY,
|
||||
0 /* user_data size */);
|
||||
|
||||
spa_zero(registry_listener);
|
||||
pw_registry_add_listener(registry, ®istry_listener,
|
||||
®istry_events, NULL);
|
||||
spa_zero(registry_listener);
|
||||
pw_registry_add_listener(registry, ®istry_listener,
|
||||
®istry_events, NULL);
|
||||
|
||||
pw_main_loop_run(loop);
|
||||
pw_main_loop_run(loop);
|
||||
|
||||
pw_proxy_destroy((struct pw_proxy*)registry);
|
||||
pw_core_disconnect(core);
|
||||
pw_context_destroy(context);
|
||||
pw_main_loop_destroy(loop);
|
||||
pw_proxy_destroy((struct pw_proxy*)registry);
|
||||
pw_core_disconnect(core);
|
||||
pw_context_destroy(context);
|
||||
pw_main_loop_destroy(loop);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
/* [code] */
|
||||
|
|
|
|||
|
|
@ -43,15 +43,15 @@ static void on_process(void *userdata)
|
|||
stride = sizeof(int16_t) * DEFAULT_CHANNELS;
|
||||
n_frames = buf->datas[0].maxsize / stride;
|
||||
|
||||
for (i = 0; i < n_frames; i++) {
|
||||
data->accumulator += M_PI_M2 * 440 / DEFAULT_RATE;
|
||||
if (data->accumulator >= M_PI_M2)
|
||||
data->accumulator -= M_PI_M2;
|
||||
for (i = 0; i < n_frames; i++) {
|
||||
data->accumulator += M_PI_M2 * 440 / DEFAULT_RATE;
|
||||
if (data->accumulator >= M_PI_M2)
|
||||
data->accumulator -= M_PI_M2;
|
||||
|
||||
val = sin(data->accumulator) * DEFAULT_VOLUME * 16767.f;
|
||||
for (c = 0; c < DEFAULT_CHANNELS; c++)
|
||||
*dst++ = val;
|
||||
}
|
||||
val = sin(data->accumulator) * DEFAULT_VOLUME * 16767.f;
|
||||
for (c = 0; c < DEFAULT_CHANNELS; c++)
|
||||
*dst++ = val;
|
||||
}
|
||||
|
||||
buf->datas[0].chunk->offset = 0;
|
||||
buf->datas[0].chunk->stride = stride;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue