Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2014-06-19 18:31:49 +0400
committerHendrik Leppkes <h.leppkes@gmail.com>2017-08-04 20:12:13 +0300
commit4132906b3fb9277f14a4e1b34f069a8ad980a7cc (patch)
tree92387cbcbb01625276c536df3cfa86a7e9048879
parent88c801ed6fcf80d3e3f759a573c9430e415118a6 (diff)
matroskadec_haali: parse bit depth from BITMAPINFOHEADER
-rw-r--r--libavformat/matroskadec_haali.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/matroskadec_haali.c b/libavformat/matroskadec_haali.c
index 951a85832c..42eb5b48c3 100644
--- a/libavformat/matroskadec_haali.c
+++ b/libavformat/matroskadec_haali.c
@@ -1038,6 +1038,7 @@ static int mkv_read_header(AVFormatContext *s)
AVStream *st;
uint32_t fourcc = 0;
AVIOContext b;
+ int bit_depth = -1;
track->info = info;
@@ -1085,7 +1086,8 @@ static int mkv_read_header(AVFormatContext *s)
if (!strcmp(info->CodecID, "V_MS/VFW/FOURCC") && info->CodecPrivateSize >= 40 && info->CodecPrivate != NULL) {
track->ms_compat = 1;
- fourcc = AV_RL32((uint8_t *)info->CodecPrivate + 16);
+ bit_depth = AV_RL16((uint8_t *)info->CodecPrivate + 14);
+ fourcc = AV_RL32((uint8_t *)info->CodecPrivate + 16);
codec_id = ff_codec_get_id(ff_codec_bmp_tags, fourcc);
} else if (!strcmp(info->CodecID, "A_MS/ACM") && info->CodecPrivateSize >= 14 && info->CodecPrivate != NULL) {
ffio_init_context(&b, (uint8_t *)info->CodecPrivate, info->CodecPrivateSize, 0, NULL, NULL, NULL, NULL);
@@ -1146,6 +1148,8 @@ static int mkv_read_header(AVFormatContext *s)
if (info->Type == TT_VIDEO) {
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_tag = fourcc;
+ if (bit_depth >= 0)
+ st->codec->bits_per_coded_sample = bit_depth;
st->codec->width = info->AV.Video.PixelWidth;
st->codec->height = info->AV.Video.PixelHeight;
if (info->AV.Video.DisplayWidth && info->AV.Video.DisplayHeight) {