From 0194b2e2055335c50e2b4a040dc9af856c63c8e6 Mon Sep 17 00:00:00 2001
From: chenguanglee <lichenguang@kylinos.cn>
Date: Fri, 22 Nov 2024 10:27:18 +0800
Subject: [PATCH] remove MPV_EVENT_TRACK_SWITCHED case

---
 src/core/mpvcore.cpp | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/src/core/mpvcore.cpp b/src/core/mpvcore.cpp
index 378db64..fca822d 100644
--- a/src/core/mpvcore.cpp
+++ b/src/core/mpvcore.cpp
@@ -1627,32 +1627,6 @@ bool MpvCore::event(QEvent *event)
 //                mpv_event_log_message *message = static_cast<mpv_event_log_message*>(event->data);
                 break;
             }
-            case MPV_EVENT_TRACK_SWITCHED:
-                KyInfo() << "[mpv event] MPV_EVENT_TRACK_SWITCHED";
-                // 轨道id改变
-                mpv_get_property(m_mpvHandle, "sid", MPV_FORMAT_INT64, &sid);
-                if (sid > m_stracks)
-                    sid = 0;
-
-                g_core_signal->notifySubId(sid);
-                if(sid != m_sid && sid >= 0)
-                {
-                    m_sid = sid;
-                    if (sid == 0) {
-                        ShowText(tr("subtitle : ").append("no"));
-                    }
-                    // 字幕改变
-                    for(Mpv::Track tck : m_fileInfo.stracks)
-                        if(tck.id == sid)
-                            ShowText(tr("subtitle : ").append(tck.title));
-                }
-                mpv_get_property(m_mpvHandle, "aid", MPV_FORMAT_INT64, &aid);
-                g_core_signal->notifyAudioId(aid);
-                mpv_get_property(m_mpvHandle, "vid", MPV_FORMAT_INT64, &vid);
-                g_core_signal->notifyVideoId(vid);
-                m_vid = vid;
-                m_aid = aid;
-                break;
             default: // unhandled events
                 break;
             }
-- 
2.43.0

