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>2014-06-19 18:31:49 +0400
commit6d12a9954be2b5a2641924f8ca1fbd743935ba8f (patch)
tree103b81ce84bd80f613335e52ee17fca6ed8e65f6
parent236b9be7dbc5d92c1fee483684624666323df078 (diff)
matroskadec_haali: parse bit depth from BITMAPINFOHEADERmpc-hc-1.7.6-1
-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 9952c45caa..e9b81a1e22 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) {