Message ID | 20250527064615.125970-1-frederic.danis@collabora.com |
---|---|
State | New |
Headers | show |
Series | [BlueZ] audio/player: Update track duration if previously set to 0 | expand |
Hello: This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Tue, 27 May 2025 08:46:15 +0200 you wrote: > Sometimes some stacks may set the track duration to 0 in GetItemAttributes > before updating it in GetPlayStatus. > > Currently the track duration is updated only if it has never been set > before. To fix the issue this also checks that the current value is > not 0. > > [...] Here is the summary with links: - [BlueZ] audio/player: Update track duration if previously set to 0 https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=bcababe6050d You are awesome, thank you!
diff --git a/profiles/audio/player.c b/profiles/audio/player.c index 0f72d7601..52844c9c0 100644 --- a/profiles/audio/player.c +++ b/profiles/audio/player.c @@ -1320,9 +1320,9 @@ void media_player_set_duration(struct media_player *mp, uint32_t duration) if (g_hash_table_size(mp->track) == 0) return; - /* Ignore if duration is already set */ + /* Ignore if duration is already set to value > 0 */ curval = g_hash_table_lookup(mp->track, "Duration"); - if (curval != NULL) + if (curval != NULL && atoi(curval) != 0) return; value = g_strdup_printf("%u", duration);