diff options
Diffstat (limited to 'demux')
-rw-r--r-- | demux/codec_tags.c | 11 | ||||
-rw-r--r-- | demux/codec_tags.h | 1 | ||||
-rw-r--r-- | demux/demux_mkv.c | 4 |
3 files changed, 16 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) { diff --git a/demux/codec_tags.h b/demux/codec_tags.h index 694f4c64d4..8fc49df751 100644 --- a/demux/codec_tags.h +++ b/demux/codec_tags.h @@ -28,6 +28,7 @@ void mp_set_codec_from_tag(struct mp_codec_params *c); void mp_set_pcm_codec(struct mp_codec_params *c, bool sign, bool is_float, int bits, bool is_be); +bool mp_codec_is_image(const char *codec); const char *mp_map_type_to_image_codec(const char *type); const char *mp_map_mimetype_to_video_codec(const char *mimetype); diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 4aa79a214e..3a00ef86d6 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -1484,6 +1484,10 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track) } const char *codec = sh_v->codec ? sh_v->codec : ""; + if (mp_codec_is_image(codec)) { + sh->still_image = true; + sh->image = true; + } if (!strcmp(codec, "mjpeg")) { sh_v->codec_tag = MKTAG('m', 'j', 'p', 'g'); track->require_keyframes = true; |