mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
parent
e68364e5b7
commit
dfbb106aa8
2 changed files with 4 additions and 13 deletions
|
|
@ -1113,9 +1113,6 @@ static void stream_io_changed(void *data, uint32_t id, void *area, uint32_t size
|
|||
{
|
||||
struct stream *stream = data;
|
||||
switch (id) {
|
||||
case SPA_IO_RateMatch:
|
||||
stream->rate_match = area;
|
||||
break;
|
||||
case SPA_IO_Position:
|
||||
stream->position = area;
|
||||
break;
|
||||
|
|
@ -4443,7 +4440,7 @@ static int do_update_stream_sample_rate(struct client *client, uint32_t command,
|
|||
{
|
||||
uint32_t channel, rate;
|
||||
struct stream *stream;
|
||||
bool match;
|
||||
float corr;
|
||||
|
||||
if (message_get(m,
|
||||
TAG_U32, &channel,
|
||||
|
|
@ -4458,15 +4455,10 @@ static int do_update_stream_sample_rate(struct client *client, uint32_t command,
|
|||
if (stream == NULL || stream->type == STREAM_TYPE_UPLOAD)
|
||||
return -ENOENT;
|
||||
|
||||
if (stream->rate_match == NULL)
|
||||
return -ENOTSUP;
|
||||
|
||||
match = rate != stream->ss.rate;
|
||||
stream->rate = rate;
|
||||
stream->rate_match->rate = match ?
|
||||
(double)rate/(double)stream->ss.rate : 1.0;
|
||||
SPA_FLAG_UPDATE(stream->rate_match->flags,
|
||||
SPA_IO_RATE_MATCH_FLAG_ACTIVE, match);
|
||||
|
||||
corr = (double)rate/(double)stream->ss.rate;
|
||||
pw_stream_set_control(stream->stream, SPA_PROP_rate, 1, &corr, NULL);
|
||||
|
||||
return reply_simple_ack(client, tag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ struct stream {
|
|||
struct pw_stream *stream;
|
||||
struct spa_hook stream_listener;
|
||||
|
||||
struct spa_io_rate_match *rate_match;
|
||||
struct spa_io_position *position;
|
||||
struct spa_ringbuffer ring;
|
||||
void *buffer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue