• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Pipewireパッケージ(ちょっと変更)


Commit MetaInfo

Revisionb094057b0b3502e1c25d3e429968d3bb8d919286 (tree)
Time2023-09-13 18:13:48
AuthorWim Taymans <wtaymans@redh...>
CommiterWim Taymans

Log Message

handle NULL latency param

Fixes #3504

Change Summary

Incremental Difference

--- a/pipewire-jack/src/pipewire-jack.c
+++ b/pipewire-jack/src/pipewire-jack.c
@@ -2442,7 +2442,6 @@ static int port_set_latency(struct client *c, struct port *p,
24422442
24432443 if (param == NULL)
24442444 return 0;
2445-
24462445 if ((res = spa_latency_parse(param, &info)) < 0)
24472446 return res;
24482447
--- a/spa/plugins/alsa/alsa-seq-bridge.c
+++ b/spa/plugins/alsa/alsa-seq-bridge.c
@@ -691,7 +691,9 @@ impl_node_port_set_param(void *object,
691691 case SPA_PARAM_Latency:
692692 {
693693 struct spa_latency_info info;
694- if ((res = spa_latency_parse(param, &info)) < 0)
694+ if (param == NULL)
695+ info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
696+ else if ((res = spa_latency_parse(param, &info)) < 0)
695697 return res;
696698 if (direction == info.direction)
697699 return -EINVAL;
--- a/spa/plugins/avb/avb-pcm-sink.c
+++ b/spa/plugins/avb/avb-pcm-sink.c
@@ -572,7 +572,9 @@ impl_node_port_set_param(void *object,
572572 case SPA_PARAM_Latency:
573573 {
574574 struct spa_latency_info info;
575- if ((res = spa_latency_parse(param, &info)) < 0)
575+ if (param == NULL)
576+ info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
577+ else if ((res = spa_latency_parse(param, &info)) < 0)
576578 return res;
577579 if (direction == info.direction)
578580 return -EINVAL;
--- a/spa/plugins/avb/avb-pcm-source.c
+++ b/spa/plugins/avb/avb-pcm-source.c
@@ -572,7 +572,9 @@ impl_node_port_set_param(void *object,
572572 case SPA_PARAM_Latency:
573573 {
574574 struct spa_latency_info info;
575- if ((res = spa_latency_parse(param, &info)) < 0)
575+ if (param == NULL)
576+ info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
577+ else if ((res = spa_latency_parse(param, &info)) < 0)
576578 return res;
577579 if (direction == info.direction)
578580 return -EINVAL;
--- a/spa/plugins/v4l2/v4l2-source.c
+++ b/spa/plugins/v4l2/v4l2-source.c
@@ -729,7 +729,9 @@ static int impl_node_port_set_param(void *object,
729729 case SPA_PARAM_Latency:
730730 {
731731 struct spa_latency_info info;
732- if ((res = spa_latency_parse(param, &info)) < 0)
732+ if (param == NULL)
733+ info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
734+ else if ((res = spa_latency_parse(param, &info)) < 0)
733735 return res;
734736 if (direction == info.direction)
735737 return -EINVAL;
--- a/src/modules/module-combine-stream.c
+++ b/src/modules/module-combine-stream.c
@@ -697,7 +697,7 @@ static void stream_param_changed(void *d, uint32_t id, const struct spa_pod *par
697697 update_delay(s->impl);
698698 break;
699699 case SPA_PARAM_Latency:
700- if (!param) {
700+ if (param == NULL) {
701701 s->have_latency = false;
702702 } else if (spa_latency_parse(param, &latency) == 0 &&
703703 latency.direction == get_combine_direction(s->impl)) {
--- a/src/modules/module-echo-cancel.c
+++ b/src/modules/module-echo-cancel.c
@@ -604,7 +604,7 @@ static void input_param_latency_changed(struct impl *impl, const struct spa_pod
604604 struct spa_pod_builder b;
605605 const struct spa_pod *params[1];
606606
607- if (spa_latency_parse(param, &latency) < 0)
607+ if (param == NULL || spa_latency_parse(param, &latency) < 0)
608608 return;
609609
610610 spa_pod_builder_init(&b, buffer, sizeof(buffer));
@@ -767,7 +767,7 @@ static void output_param_latency_changed(struct impl *impl, const struct spa_pod
767767 struct spa_pod_builder b;
768768 const struct spa_pod *params[1];
769769
770- if (spa_latency_parse(param, &latency) < 0)
770+ if (param == NULL || spa_latency_parse(param, &latency) < 0)
771771 return;
772772
773773 spa_pod_builder_init(&b, buffer, sizeof(buffer));
--- a/src/modules/module-example-filter.c
+++ b/src/modules/module-example-filter.c
@@ -227,7 +227,7 @@ static void param_latency_changed(struct impl *impl, const struct spa_pod *param
227227 struct spa_pod_builder b;
228228 const struct spa_pod *params[1];
229229
230- if (spa_latency_parse(param, &latency) < 0)
230+ if (param == NULL || spa_latency_parse(param, &latency) < 0)
231231 return;
232232
233233 *info = latency;
--- a/src/modules/module-ffado-driver.c
+++ b/src/modules/module-ffado-driver.c
@@ -417,7 +417,7 @@ static void param_latency_changed(struct stream *s, const struct spa_pod *param,
417417 bool update = false;
418418 enum spa_direction direction = port->direction;
419419
420- if (spa_latency_parse(param, &latency) < 0)
420+ if (param == NULL || spa_latency_parse(param, &latency) < 0)
421421 return;
422422
423423 if (spa_latency_info_compare(&port->latency[direction], &latency)) {
--- a/src/modules/module-jack-tunnel.c
+++ b/src/modules/module-jack-tunnel.c
@@ -410,7 +410,7 @@ static void param_latency_changed(struct stream *s, const struct spa_pod *param,
410410 bool update = false;
411411 enum spa_direction direction = port->direction;
412412
413- if (spa_latency_parse(param, &latency) < 0)
413+ if (param == NULL || spa_latency_parse(param, &latency) < 0)
414414 return;
415415
416416 if (spa_latency_info_compare(&port->latency[direction], &latency)) {
--- a/src/modules/module-netjack2-driver.c
+++ b/src/modules/module-netjack2-driver.c
@@ -371,7 +371,7 @@ static void param_latency_changed(struct stream *s, const struct spa_pod *param,
371371 bool update = false;
372372 enum spa_direction direction = port->direction;
373373
374- if (spa_latency_parse(param, &latency) < 0)
374+ if (param == NULL || spa_latency_parse(param, &latency) < 0)
375375 return;
376376
377377 if (spa_latency_info_compare(&port->latency[direction], &latency)) {
--- a/src/modules/module-netjack2-manager.c
+++ b/src/modules/module-netjack2-manager.c
@@ -493,7 +493,7 @@ static void param_latency_changed(struct stream *s, const struct spa_pod *param,
493493 bool update = false;
494494 enum spa_direction direction = port->direction;
495495
496- if (spa_latency_parse(param, &latency) < 0)
496+ if (param == NULL || spa_latency_parse(param, &latency) < 0)
497497 return;
498498
499499 if (spa_latency_info_compare(&port->latency[direction], &latency)) {