调试elementary Videos #32问题:ClutterGST仅加载同名外部字幕
I'm currently working through issue #32 in elementary Videos, where external subtitle files refuse to load unless their filename exactly matches the corresponding video file (ignoring file extensions). Here's a breakdown of what I've found so far:
Key Observations
- When calling
ClutterGst.Playback.set_subtitle_uri, subtitles only successfully load if the subtitle file shares the exact base name as the video. For example,video.mp4will loadvideo.srt, but won't recognizevideo_subs.srteven when the correct URI is passed. - Oddly enough, passing a non-existent file path to this method doesn't trigger any error messages—no warnings, no exceptions, nothing to indicate the path is invalid.
- The
subtitle-urisignal is consistently triggered every timeset_subtitle_uriis called, regardless of whether the subtitle file exists or matches the video's filename.
GStreamer 1.0 Baseline Check
This behavior doesn't stem from GStreamer 1.0 itself. I ran multiple tests using gst-launch commands, and in every case, external subtitles loaded correctly even when their filenames didn't match the video's. This confirms the issue is specific to how elementary Videos is implementing ClutterGst.Playback, not the underlying multimedia framework.
Reproduction Resource
To help isolate the problem, I've put together a minimal, simplified code example that reproduces the exact behavior described. This example focuses solely on the ClutterGst.Playback subtitle handling logic, making it easier to pinpoint where the implementation is breaking down.
内容的提问来源于stack exchange,提问作者Peter Uithoven

