summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-09 13:37:55 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-09 13:37:55 +0000
commit77195cf5c40e77e9876c4a82808f1819c1d3840b (patch)
tree66ba31281a963a7928d918092ff2eea524d91fb2 /libmpcodecs
parent3a0ffa5bf43a000ce8b0d4a3bd9572dc92f83ff4 (diff)
downloadmpv-77195cf5c40e77e9876c4a82808f1819c1d3840b.tar.bz2
mpv-77195cf5c40e77e9876c4a82808f1819c1d3840b.tar.xz
nuv encoder 64 bit fix: avoid using long/sizeof(long)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28909 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ve_nuv.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libmpcodecs/ve_nuv.c b/libmpcodecs/ve_nuv.c
index 0b670179cd..4b1691a932 100644
--- a/libmpcodecs/ve_nuv.c
+++ b/libmpcodecs/ve_nuv.c
@@ -68,6 +68,8 @@ m_option_t nuvopts_conf[]={
//===========================================================================//
+#define COMPDATASIZE (128*4)
+
static int config(struct vf_instance_s* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
@@ -75,8 +77,8 @@ static int config(struct vf_instance_s* vf,
// We need a buffer wich can holda header and a whole YV12 picture
// or a RTJpeg table
vf->priv->buf_size = width*height*3/2+FRAMEHEADERSIZE;
- if(vf->priv->buf_size < (int)(128*sizeof(long int) + FRAMEHEADERSIZE))
- vf->priv->buf_size = 128*sizeof(long int) + FRAMEHEADERSIZE;
+ if(vf->priv->buf_size < COMPDATASIZE + FRAMEHEADERSIZE)
+ vf->priv->buf_size = COMPDATASIZE + FRAMEHEADERSIZE;
mux_v->bih->biWidth=width;
mux_v->bih->biHeight=height;
@@ -110,16 +112,16 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
// This has to be don here otherwise tv with sound doesn't work
if(!vf->priv->tbl_wrote) {
- RTjpeg_init_compress((long int*)data,mpi->width,mpi->height,vf->priv->q);
+ RTjpeg_init_compress((uint32_t *)data,mpi->width,mpi->height,vf->priv->q);
RTjpeg_init_mcompress();
ench->frametype = 'D'; // compressor data
ench->comptype = 'R'; // compressor data for RTjpeg
- ench->packetlength = 128*sizeof(long int);
+ ench->packetlength = COMPDATASIZE;
le2me_rtframeheader(ench);
mux_v->buffer=vf->priv->buffer;
- muxer_write_chunk(mux_v,FRAMEHEADERSIZE + 128*sizeof(long int), 0x10, MP_NOPTS_VALUE, MP_NOPTS_VALUE);
+ muxer_write_chunk(mux_v,FRAMEHEADERSIZE + COMPDATASIZE, 0x10, MP_NOPTS_VALUE, MP_NOPTS_VALUE);
vf->priv->tbl_wrote = 1;
memset(ench,0,FRAMEHEADERSIZE); // Reset the header
}