summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-28 16:05:19 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-28 16:05:19 +0000
commit0de2157fa4117aac26f5b9d3704ecd586356ba3f (patch)
treedaabe45f9b68426ff8eaf6e25c341f7628f3affc
parent2c62e737f4671f4812d1e92e07cf35e3cd21d1e1 (diff)
set codec bps to grayscale bits, fix 256grey.mov
Originally committed as revision 12272 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0b3c0a4bc0..a67604b0e0 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -725,7 +725,8 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
st->codec->bits_per_sample = get_be16(pb); /* depth */
st->codec->color_table_id = get_be16(pb); /* colortable id */
-
+ dprintf(c->fc, "depth %d, ctab id %d\n",
+ st->codec->bits_per_sample, st->codec->color_table_id);
/* figure out the palette situation */
color_depth = st->codec->bits_per_sample & 0x1F;
color_greyscale = st->codec->bits_per_sample & 0x20;
@@ -735,6 +736,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
(color_depth == 8)) {
if (color_greyscale) {
/* compute the greyscale palette */
+ st->codec->bits_per_sample = color_depth;
color_count = 1 << color_depth;
color_index = 255;
color_dec = 256 / (color_count - 1);