diff options
author | Dudemanguy <random342@airmail.cc> | 2023-10-21 01:04:16 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-23 19:32:53 +0000 |
commit | 4709a94aec5b16534b1d6b0d6738caeaf692e9c9 (patch) | |
tree | 06446ed08598d14139a44bb6003f56cec163265b /demux/codec_tags.c | |
parent | be0a979a0b17b49f8535ee2542cca7df4c35b04d (diff) | |
download | mpv-4709a94aec5b16534b1d6b0d6738caeaf692e9c9.tar.bz2 mpv-4709a94aec5b16534b1d6b0d6738caeaf692e9c9.tar.xz |
demux_mkv: check if the video codec is an image
Add a simple helper to codec_tags to check if the codec name matches one
of the images. If so, then we set still_image and image in the stream as
true (slightly different semanatics).
Diffstat (limited to 'demux/codec_tags.c')
-rw-r--r-- | demux/codec_tags.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/demux/codec_tags.c b/demux/codec_tags.c index accc1d918d..0e7b13ce6d 100644 --- a/demux/codec_tags.c +++ b/demux/codec_tags.c @@ -233,6 +233,17 @@ static const char *const type_to_codec[][2] = { {0} }; +bool mp_codec_is_image(const char *codec) +{ + if (codec) { + for (int n = 0; type_to_codec[n][0]; n++) { + if (strcasecmp(type_to_codec[n][1], codec) == 0) + return true; + } + } + return false; +} + const char *mp_map_type_to_image_codec(const char *type) { if (type) { |