player: fix cover-art-files overriding embedded video tracks

When comparing external cover art images with embedded video tracks,
the external-vs-internal preference should not apply. Without this
check, --cover-art-files causes video files to be treated as audio
by selecting the external image over the embedded video stream.

Only apply the external track preference when both tracks have the
same image type (both images or both non-images).

Fixes #12219
This commit is contained in:
Wang Yu authored and Dudemanguy committed 2026-06-16 16:17:48 +00:00
1 parent cab6fbe222
commit 9baeefe635
1 file changed
+1 -1
+1 -1
View File
@@ -524,7 +524,7 @@ static bool compare_track(struct track *t1, struct track *t2, char **langs, bool
bool sub = t2->type == STREAM_SUB;
bool ext1 = t1->is_external && !t1->no_default;
bool ext2 = t2->is_external && !t2->no_default;
if (ext1 != ext2) {
if (ext1 != ext2 && t1->image == t2->image) {
if (t1->attached_picture && t2->attached_picture
&& opts->audio_display == 1)
return !ext1;