GstEnginePipeline: Set Spotify bitrate to 320

This commit is contained in:
Jonas Kvinge 2024-08-01 23:22:19 +02:00
parent c2a7509e0e
commit d3dd26c596
1 changed files with 11 additions and 7 deletions

View File

@ -1006,13 +1006,17 @@ void GstEnginePipeline::SourceSetupCallback(GstElement *playbin, GstElement *sou
} }
#ifdef HAVE_SPOTIFY #ifdef HAVE_SPOTIFY
if (instance->media_url_.scheme() == QStringLiteral("spotify") && if (instance->media_url_.scheme() == QStringLiteral("spotify")) {
!instance->spotify_username_.isEmpty() && if (g_object_class_find_property(G_OBJECT_GET_CLASS(source), "bitrate")) {
!instance->spotify_password_.isEmpty() && g_object_set(source, "bitrate", 2, nullptr);
g_object_class_find_property(G_OBJECT_GET_CLASS(source), "username") && }
g_object_class_find_property(G_OBJECT_GET_CLASS(source), "password")) { if (!instance->spotify_username_.isEmpty() &&
g_object_set(source, "username", instance->spotify_username_.toUtf8().constData(), nullptr); !instance->spotify_password_.isEmpty() &&
g_object_set(source, "password", instance->spotify_password_.toUtf8().constData(), nullptr); g_object_class_find_property(G_OBJECT_GET_CLASS(source), "username") &&
g_object_class_find_property(G_OBJECT_GET_CLASS(source), "password")) {
g_object_set(source, "username", instance->spotify_username_.toUtf8().constData(), nullptr);
g_object_set(source, "password", instance->spotify_password_.toUtf8().constData(), nullptr);
}
} }
#endif #endif