From 9954fe01a91494b7b631d50a35e7c1d43b729529 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Thu, 14 Oct 2021 16:36:57 +0200 Subject: player: add track-list/N/image sub-property This exposes whether a video track is detected as an image, which is useful for profile conditions, property expansion and lavfi-complex. The lavf demuxer sets image to true when the existing check detects an image. When the lavf demuxer fails, the mf one guesses if the file is an image by its extension, so sh->image is set to true when the mf demuxer succeds and there's only one file. The mkv demuxer just sets image to true for any attached picture. The timeline demuxer just copies the value of image from source to destination. This sets image to true for attached pictures, standalone images and images added with !new_stream in EDL playlists, but it is imperfect since you could concatenate multiple images in an EDL playlist (which should be done with the mf demuxer anyway). This is good enough anyway since the comment of the modified function already says it is "Imperfect and arbitrary". --- player/loadfile.c | 1 + 1 file changed, 1 insertion(+) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 3c0415aed6..51865cf191 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -421,6 +421,7 @@ static struct track *add_stream_track(struct MPContext *mpctx, .dependent_track = stream->dependent_track, .visual_impaired_track = stream->visual_impaired_track, .hearing_impaired_track = stream->hearing_impaired_track, + .image = stream->image, .attached_picture = stream->attached_picture != NULL, .lang = stream->lang, .demuxer = demuxer, -- cgit v1.2.3