mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-29 06:46:38 -04:00
parent
b2790f610c
commit
9f3d894c10
1 changed files with 12 additions and 3 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
#include <spa/node/node.h>
|
#include <spa/node/node.h>
|
||||||
#include <spa/node/utils.h>
|
#include <spa/node/utils.h>
|
||||||
#include <spa/node/io.h>
|
#include <spa/node/io.h>
|
||||||
|
#include <spa/utils/ratelimit.h>
|
||||||
#include <spa/param/audio/format-utils.h>
|
#include <spa/param/audio/format-utils.h>
|
||||||
#include <spa/param/param.h>
|
#include <spa/param/param.h>
|
||||||
#include <spa/pod/filter.h>
|
#include <spa/pod/filter.h>
|
||||||
|
|
@ -125,6 +126,8 @@ struct impl {
|
||||||
unsigned int started:1;
|
unsigned int started:1;
|
||||||
|
|
||||||
struct spa_list mix_list;
|
struct spa_list mix_list;
|
||||||
|
|
||||||
|
struct spa_ratelimit rate_limit;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CHECK_ANY_IN(this,d,p) ((d) == SPA_DIRECTION_INPUT && (p) == SPA_ID_INVALID)
|
#define CHECK_ANY_IN(this,d,p) ((d) == SPA_DIRECTION_INPUT && (p) == SPA_ID_INVALID)
|
||||||
|
|
@ -846,9 +849,12 @@ static int impl_node_process(void *object)
|
||||||
|
|
||||||
outb = dequeue_buffer(this, outport);
|
outb = dequeue_buffer(this, outport);
|
||||||
if (SPA_UNLIKELY(outb == NULL)) {
|
if (SPA_UNLIKELY(outb == NULL)) {
|
||||||
if (outport->n_buffers > 0)
|
int suppressed;
|
||||||
spa_log_warn(this->log, "%p: out of buffers (%d)", this,
|
if (outport->n_buffers > 0 &&
|
||||||
outport->n_buffers);
|
(suppressed = spa_ratelimit_test(&this->rate_limit,
|
||||||
|
this->position->clock.nsec)) >= 0)
|
||||||
|
spa_log_warn(this->log, "%p: (%d suppressed) out of buffers (%d)", this,
|
||||||
|
suppressed, outport->n_buffers);
|
||||||
return -EPIPE;
|
return -EPIPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -984,6 +990,9 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
spa_list_init(&this->free_list);
|
spa_list_init(&this->free_list);
|
||||||
spa_list_init(&this->mix_list);
|
spa_list_init(&this->mix_list);
|
||||||
|
|
||||||
|
this->rate_limit.interval = 2 * SPA_NSEC_PER_SEC;
|
||||||
|
this->rate_limit.burst = 1;
|
||||||
|
|
||||||
this->node.iface = SPA_INTERFACE_INIT(
|
this->node.iface = SPA_INTERFACE_INIT(
|
||||||
SPA_TYPE_INTERFACE_Node,
|
SPA_TYPE_INTERFACE_Node,
|
||||||
SPA_VERSION_NODE,
|
SPA_VERSION_NODE,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue