summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2014-02-26 00:02:51 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2014-02-26 00:02:51 +0100
commit96fc2908f0c04d2759d6c20275150d65798de4ac (patch)
tree7c7a75bf8b8960d05b57d999683040f1217f2982 /libavformat/matroskadec.c
parent2673357048ebc7467063f62fa9bf8417b9f1c215 (diff)
Read bits_per_coded_sample from V_MS/VFW/FOURCC mkv files.
Fixes ticket #3425.
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index f91688b4ad..8c0ccb0a02 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1605,6 +1605,7 @@ static int matroska_read_header(AVFormatContext *s)
uint32_t fourcc = 0;
AVIOContext b;
char* key_id_base64 = NULL;
+ int bit_depth = -1;
/* Apply some sanity checks. */
if (track->type != MATROSKA_TRACK_TYPE_VIDEO &&
@@ -1708,6 +1709,7 @@ static int matroska_read_header(AVFormatContext *s)
&& track->codec_priv.size >= 40
&& track->codec_priv.data != NULL) {
track->ms_compat = 1;
+ bit_depth = AV_RL16(track->codec_priv.data + 14);
fourcc = AV_RL32(track->codec_priv.data + 16);
codec_id = ff_codec_get_id(ff_codec_bmp_tags, fourcc);
extradata_offset = 40;
@@ -1879,6 +1881,8 @@ static int matroska_read_header(AVFormatContext *s)
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 = track->video.pixel_width;
st->codec->height = track->video.pixel_height;
av_reduce(&st->sample_aspect_ratio.num,