summaryrefslogtreecommitdiff
path: root/media-video/pipewire/files/pipewire-0.3.63-rate-update.patch
blob: 91487def58e213779e8dcbb9b98751fbdbc983b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/860b8fc27ffbfd0a095e3fa4b0cd125d536283d3
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2915
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2891

From 860b8fc27ffbfd0a095e3fa4b0cd125d536283d3 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Thu, 29 Dec 2022 12:22:56 +0100
Subject: [PATCH] modules: fix rate update

Setting the rate with the PROP_rate would actually result in a rate
adjustment of 1.0f / rate, so do the same here.

See #2891
--- a/src/modules/module-pulse-tunnel.c
+++ b/src/modules/module-pulse-tunnel.c
@@ -270,7 +270,7 @@ static void update_rate(struct impl *impl, bool playback)
 			impl->current_latency, impl->target_latency);
 
 	SPA_FLAG_SET(impl->rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE);
-	impl->rate_match->rate = corr;
+	impl->rate_match->rate = 1.0f / corr;
 }
 
 static void playback_stream_process(void *d)
--- a/src/modules/module-rtp-source.c
+++ b/src/modules/module-rtp-source.c
@@ -272,7 +272,7 @@ static void stream_process(void *data)
 
 			if (sess->rate_match) {
 				SPA_FLAG_SET(sess->rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE);
-				sess->rate_match->rate = corr;
+				sess->rate_match->rate = 1.0f / corr;
 			}
 		}
 		spa_ringbuffer_read_data(&sess->ring,
-- 
GitLab