summaryrefslogtreecommitdiff
path: root/src/libxinevdec/msvc.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2002-06-25 03:37:52 +0000
committerMike Melanson <mike@multimedia.cx>2002-06-25 03:37:52 +0000
commit21bea7e4ba8963fe942cec7741635ae259dd33c0 (patch)
tree697ee7bd27b0ea9a9968cc9886cb6115edfff6a7 /src/libxinevdec/msvc.c
parent047b977dd4386dbb3b5ab11dbd136e378be40cf4 (diff)
downloadxine-lib-21bea7e4ba8963fe942cec7741635ae259dd33c0.tar.gz
xine-lib-21bea7e4ba8963fe942cec7741635ae259dd33c0.tar.bz2
added support in buffer.h for transporting RGB palette from the demuxer to
the decoder; modified AVI demuxer and MSVC decoder to support this feature CVS patchset: 2160 CVS date: 2002/06/25 03:37:52
Diffstat (limited to 'src/libxinevdec/msvc.c')
-rw-r--r--src/libxinevdec/msvc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libxinevdec/msvc.c b/src/libxinevdec/msvc.c
index a592ce2d5..3db4681e8 100644
--- a/src/libxinevdec/msvc.c
+++ b/src/libxinevdec/msvc.c
@@ -22,7 +22,7 @@
* based on overview of Microsoft Video-1 algorithm
* by Mike Melanson: http://www.pcisys.net/~melanson/codecs/video1.txt
*
- * $Id: msvc.c,v 1.5 2002/06/03 17:31:29 esnel Exp $
+ * $Id: msvc.c,v 1.6 2002/06/25 03:37:53 tmmm Exp $
*/
#include <stdlib.h>
@@ -203,9 +203,24 @@ static void msvc_init (video_decoder_t *this_gen, vo_instance_t *video_out) {
static void msvc_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
msvc_decoder_t *this = (msvc_decoder_t *) this_gen;
+ int i;
+ palette_entry_t *palette;
+
if (buf->decoder_flags & BUF_FLAG_PREVIEW)
return;
+ if ((buf->decoder_flags & BUF_FLAG_SPECIAL) &&
+ (buf->decoder_info[1] == BUF_SPECIAL_PALETTE)) {
+ palette = (palette_entry_t *)buf->decoder_info[3];
+ for (i = 0; i < buf->decoder_info[2]; i++)
+ rgb_to_yuy2(
+ 32,
+ (palette[i].r << 16) |
+ (palette[i].g << 8) |
+ (palette[i].b << 0),
+ &this->color_table[i]);
+ }
+
if (buf->decoder_flags & BUF_FLAG_HEADER) {
xine_bmiheader *bih;