@@ -255,7 +255,7 @@ void AutoConfigStreamPage::on_show_clicked()
255255
256256void AutoConfigStreamPage::OnOAuthStreamKeyConnected ()
257257{
258- OAuthStreamKey *a = reinterpret_cast <OAuthStreamKey *>(auth.get ());
258+ OAuthStreamKey *a = dynamic_cast <OAuthStreamKey *>(auth.get ());
259259
260260 if (a) {
261261 bool validKey = !a->key ().empty ();
@@ -281,16 +281,17 @@ void AutoConfigStreamPage::OnOAuthStreamKeyConnected()
281281
282282 ui->connectedAccountText ->setText (QTStr (" Auth.LoadingChannel.Title" ));
283283
284- YoutubeApiWrappers *ytAuth = reinterpret_cast <YoutubeApiWrappers *>(a);
285- ChannelDescription cd;
286- if (ytAuth->GetChannelDescription (cd)) {
287- ui->connectedAccountText ->setText (cd.title );
288-
289- /* Create throwaway stream key for bandwidth test */
290- if (ui->doBandwidthTest ->isChecked ()) {
291- StreamDescription stream = {" " , " " , " OBS Studio Test Stream" };
292- if (ytAuth->InsertStream (stream)) {
293- ui->key ->setText (stream.name );
284+ if (YoutubeApiWrappers *ytAuth = dynamic_cast <YoutubeApiWrappers *>(a)) {
285+ ChannelDescription cd;
286+ if (ytAuth->GetChannelDescription (cd)) {
287+ ui->connectedAccountText ->setText (cd.title );
288+
289+ /* Create throwaway stream key for bandwidth test */
290+ if (ui->doBandwidthTest ->isChecked ()) {
291+ StreamDescription stream = {" " , " " , " OBS Studio Test Stream" };
292+ if (ytAuth->InsertStream (stream)) {
293+ ui->key ->setText (stream.name );
294+ }
294295 }
295296 }
296297 }
@@ -395,7 +396,7 @@ void AutoConfigStreamPage::reset_service_ui_fields(std::string &service)
395396{
396397#ifdef YOUTUBE_ENABLED
397398 // when account is already connected:
398- OAuthStreamKey *a = reinterpret_cast <OAuthStreamKey *>(auth.get ());
399+ OAuthStreamKey *a = dynamic_cast <OAuthStreamKey *>(auth.get ());
399400 if (a && service == a->service () && IsYouTubeService (a->service ())) {
400401 ui->connectedAccountLabel ->setVisible (true );
401402 ui->connectedAccountText ->setVisible (true );
0 commit comments