Skip to content

Commit 3e10309

Browse files
committed
player/loadfile: prefer non-image when selecting video track
This fixes `ytdl_hook`, which would start playback with the thumbnail track selected. This issue occurs because the thumbnail track is added first. If the main track is not marked as default afterward, which it isn't for single streams, the first track (the image track) would be selected. In general, if a non-image track is available, it should be preferred.
1 parent 7f49806 commit 3e10309

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

player/loadfile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ static bool compare_track(struct track *t1, struct track *t2, char **langs, bool
491491
return l1 > l2;
492492
if (t1->attached_picture != t2->attached_picture)
493493
return !t1->attached_picture;
494+
if (t1->image != t2->image)
495+
return !t1->image;
494496
if (t1->stream && t2->stream && opts->hls_bitrate >= 0 &&
495497
t1->stream->hls_bitrate != t2->stream->hls_bitrate)
496498
{

0 commit comments

Comments
 (0)