diff options
author | Eduard Hasenleithner <ehasenle@users.sourceforge.net> | 2001-08-16 12:33:00 +0000 |
---|---|---|
committer | Eduard Hasenleithner <ehasenle@users.sourceforge.net> | 2001-08-16 12:33:00 +0000 |
commit | f97eaa174cdc767a986550c710a98bb2877a01f1 (patch) | |
tree | 28a20c6a8abc26c4ae9b1ceffeb298b3beb41deb /src/libspudec/xine_decoder.c | |
parent | 5e0c7d8f50c9b2173444b1a8f87af97fe2286410 (diff) | |
download | xine-lib-f97eaa174cdc767a986550c710a98bb2877a01f1.tar.gz xine-lib-f97eaa174cdc767a986550c710a98bb2877a01f1.tar.bz2 |
clut_t is now stored in machine endianess. Simplifies the transfer
of the clut from the input plugin.
CVS patchset: 434
CVS date: 2001/08/16 12:33:00
Diffstat (limited to 'src/libspudec/xine_decoder.c')
-rw-r--r-- | src/libspudec/xine_decoder.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c index 7e87c8822..1900ae384 100644 --- a/src/libspudec/xine_decoder.c +++ b/src/libspudec/xine_decoder.c @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.9 2001/08/15 09:07:16 ehasenle Exp $ + * $Id: xine_decoder.c,v 1.10 2001/08/16 12:33:00 ehasenle Exp $ * * stuff needed to turn libspu into a xine decoder plugin */ @@ -35,11 +35,13 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <byteswap.h> #include "spu.h" #include "buffer.h" #include "events.h" #include "xine_internal.h" +#include "video_out/alphablend.h" static clut_t __default_clut[] = { {y: 0x00, cr: 0x80, cb:0x80}, @@ -123,10 +125,20 @@ void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) { spudec_decoder_t *this = (spudec_decoder_t *) this_gen; if (buf->type == BUF_SPU_CLUT) { - memcpy(this->state.clut, buf->content, sizeof(int32_t)*16); + if (buf->content[0]) { /* cheap endianess detection */ + memcpy(this->state.clut, buf->content, sizeof(uint32_t)*16); + } else { + int i; + uint32_t *clut = (uint32_t*) buf->content; + for (i = 0; i < 16; i++) + this->state.clut[i] = bswap_32(clut[i]); + } return; } + if (buf->decoder_info[0] == 0) /* skip preview data */ + return; + if (buf->PTS) { metronom_t *metronom = this->ovl_src.metronom; uint32_t pts = metronom->got_spu_packet(metronom, buf->PTS, 0); |