player/loadfile: prefer independent track when selecting track

Dependent tracks are supposed to be processed further and not directly
used.

For example, an HEIF tiled image tracks are meant to be stitched into a
full image before being displayed and requires special handling.

Another example would be MPEG-TS audio track tagged with mix_type=0.
Which means that the audio stream is a dependent stream and is intended
to be mixed or combined with a separate complete and independent audio
stream by the receiver.

In either case we should not directly select such tracks.
This commit is contained in:
Kacper Michajłow
2024-11-26 10:49:56 +01:00
committed by sfan5
parent 81db3446fa
commit ad1fb9f448

View File

@@ -493,6 +493,8 @@ static bool compare_track(struct track *t1, struct track *t2, char **langs, bool
return !t1->attached_picture;
if (t1->image != t2->image)
return !t1->image;
if (t1->dependent_track != t2->dependent_track)
return !t1->dependent_track;
if (t1->stream && t2->stream && opts->hls_bitrate >= 0 &&
t1->stream->hls_bitrate != t2->stream->hls_bitrate)
{