summaryrefslogtreecommitdiff
path: root/src/libspudec
diff options
context:
space:
mode:
authorEduard Hasenleithner <ehasenle@users.sourceforge.net>2001-08-16 12:33:00 +0000
committerEduard Hasenleithner <ehasenle@users.sourceforge.net>2001-08-16 12:33:00 +0000
commitf97eaa174cdc767a986550c710a98bb2877a01f1 (patch)
tree28a20c6a8abc26c4ae9b1ceffeb298b3beb41deb /src/libspudec
parent5e0c7d8f50c9b2173444b1a8f87af97fe2286410 (diff)
downloadxine-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')
-rw-r--r--src/libspudec/spu.h12
-rw-r--r--src/libspudec/xine_decoder.c16
2 files changed, 15 insertions, 13 deletions
diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h
index 6899c7af8..42de3a9ea 100644
--- a/src/libspudec/spu.h
+++ b/src/libspudec/spu.h
@@ -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: spu.h,v 1.3 2001/08/13 12:52:33 ehasenle Exp $
+ * $Id: spu.h,v 1.4 2001/08/16 12:33:00 ehasenle Exp $
*
* This file was originally part of the OMS program.
*
@@ -35,16 +35,6 @@
#include <inttypes.h>
#include "video_out.h"
-#ifndef CLUT_T
-#define CLUT_T
-typedef struct { // CLUT == Color LookUp Table
- uint8_t:8;
- uint8_t y:8;
- uint8_t cr:8;
- uint8_t cb:8;
-} __attribute__ ((packed)) clut_t;
-#endif
-
typedef struct spu_clut_struct {
#ifdef WORDS_BIGENDIAN
uint8_t entry0 : 4;
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);