From 5cb036aff44c2ff274ec38b28382245c5f695689 Mon Sep 17 00:00:00 2001 From: Rocky Bernstein Date: Thu, 19 Feb 2004 02:50:24 +0000 Subject: Mandrake patches from http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/SPECS/xine-lib/ via Goetz Waschk who reports: The amd64 patch (xine-lib-1-rc0a-amd64.patch) sets some conservative CFLAGS for amd64, the lib64 patch (xine-lib-1-rc0a-lib64.patch) replaces hardcoded /lib to support the lib64 library dir on amd64, the directfb patch (xine-lib-1-rc2-no-directfb.patch) adds a configure option to disable directfb, the linuxfb patch (xine-lib-1-rc3a-no-linuxfb.patch) does the same for linux framebuffer and the 64bit fixes patch (xine-lib-1-rc3-64bit-fixes.patch) doesn't apply at the moment against the CVS -- demux_ogg.c was not applied. it includes some 64 bit pointer and other fixes for 64bit architectures. from Gwenole Beauchesne I haven't tested other than apply and compile. CVS patchset: 6174 CVS date: 2004/02/19 02:50:24 --- src/demuxers/demux_mng.c | 6 ++--- src/input/libdvdnav/dvd_reader.c | 10 ++++----- src/input/libdvdnav/dvd_udf.c | 14 ++++++------ src/input/libdvdnav/read_cache.c | 6 ++--- src/libxineadec/nosefart/memguard.c | 29 ++++++++++++++++++++++-- src/post/goom/filters.c | 7 +++--- src/post/goom/goom_core.c | 9 ++++---- src/video_out/alphablend.c | 35 ++++++++++++++++------------- src/video_out/yuv2rgb.c | 4 ++-- src/xine-engine/metronom.c | 44 ++++++++++++++++++------------------- src/xine-engine/video_out.c | 23 +++++++++---------- 11 files changed, 110 insertions(+), 77 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c index 2c6946692..22617cf00 100644 --- a/src/demuxers/demux_mng.c +++ b/src/demuxers/demux_mng.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_mng.c,v 1.20 2004/01/12 17:35:15 miguelfreitas Exp $ + * $Id: demux_mng.c,v 1.21 2004/02/19 02:50:25 rockyb Exp $ * * demux_mng.c, Demuxer plugin for Multiple-image Network Graphics format * @@ -73,11 +73,11 @@ typedef struct { demux_class_t demux_class; } demux_mng_class_t; -static mng_ptr mymng_alloc(mng_uint32 size){ +static mng_ptr mymng_alloc(mng_size_t size){ return (mng_ptr)calloc(1, size); } -static void mymng_free(mng_ptr p, mng_uint32 size){ +static void mymng_free(mng_ptr p, mng_size_t size){ free(p); } diff --git a/src/input/libdvdnav/dvd_reader.c b/src/input/libdvdnav/dvd_reader.c index a96801c9d..b173a130e 100644 --- a/src/input/libdvdnav/dvd_reader.c +++ b/src/input/libdvdnav/dvd_reader.c @@ -1020,7 +1020,7 @@ ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size ) ( ( ( seek_byte + byte_size ) % DVD_VIDEO_LB_LEN ) ? 1 : 0 ); secbuf_base = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN + 2048 ); - secbuf = (unsigned char *)(((uintptr_t)secbuf_base & ~2047) + 2048); + secbuf = (unsigned char *)(((uintptr_t)secbuf_base & ~((uintptr_t)2047)) + 2048); if( !secbuf_base ) { fprintf( stderr, "libdvdread: Can't allocate memory " "for file read!\n" ); @@ -1074,7 +1074,7 @@ int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid ) ssize_t bytes_read; size_t file_size = dvd_file->filesize * DVD_VIDEO_LB_LEN; char *buffer_base = malloc( file_size + 2048 ); - char *buffer = (unsigned char *)(((uintptr_t)buffer_base & ~2047) + 2048); + char *buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048); if( buffer_base == NULL ) { fprintf( stderr, "libdvdread: DVDDiscId, failed to " @@ -1083,8 +1083,8 @@ int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid ) } bytes_read = DVDReadBytes( dvd_file, buffer, file_size ); if( bytes_read != file_size ) { - fprintf( stderr, "libdvdread: DVDDiscId read returned %d bytes" - ", wanted %d\n", bytes_read, file_size ); + fprintf( stderr, "libdvdread: DVDDiscId read returned %zd bytes" + ", wanted %zd\n", bytes_read, file_size ); DVDCloseFile( dvd_file ); free( buffer_base ); return -1; @@ -1119,7 +1119,7 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd, } buffer_base = malloc( DVD_VIDEO_LB_LEN + 2048 ); - buffer = (unsigned char *)(((uintptr_t)buffer_base & ~2047) + 2048); + buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048); if( buffer_base == NULL ) { fprintf( stderr, "libdvdread: DVDISOVolumeInfo, failed to " diff --git a/src/input/libdvdnav/dvd_udf.c b/src/input/libdvdnav/dvd_udf.c index d7adac891..8932bfcb9 100644 --- a/src/input/libdvdnav/dvd_udf.c +++ b/src/input/libdvdnav/dvd_udf.c @@ -489,7 +489,7 @@ static int UDFMapICB( dvd_reader_t *device, struct AD ICB, uint8_t *FileType, struct Partition *partition, struct AD *File ) { uint8_t LogBlock_base[DVD_VIDEO_LB_LEN + 2048]; - uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~2047) + 2048); + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048); uint32_t lbnum; uint16_t TagID; struct icbmap tmpmap; @@ -534,7 +534,7 @@ static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName, { char filename[ MAX_UDF_FILE_NAME_LEN ]; uint8_t directory_base[ 2 * DVD_VIDEO_LB_LEN + 2048]; - uint8_t *directory = (uint8_t *)(((uintptr_t)directory_base & ~2047) + 2048); + uint8_t *directory = (uint8_t *)(((uintptr_t)directory_base & ~((uintptr_t)2047)) + 2048); uint32_t lbnum; uint16_t TagID; uint8_t filechar; @@ -556,7 +556,7 @@ static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName, if((cached_dir_base = malloc(dir_lba * DVD_VIDEO_LB_LEN + 2048)) == NULL) { return 0; } - cached_dir = (uint8_t *)(((uintptr_t)cached_dir_base & ~2047) + 2048); + cached_dir = (uint8_t *)(((uintptr_t)cached_dir_base & ~((uintptr_t)2047)) + 2048); if( DVDReadLBUDF( device, lbnum, dir_lba, cached_dir, 0) <= 0 ) { free(cached_dir_base); cached_dir = NULL; @@ -647,7 +647,7 @@ static int UDFGetAVDP( dvd_reader_t *device, struct avdp_t *avdp) { uint8_t Anchor_base[ DVD_VIDEO_LB_LEN + 2048 ]; - uint8_t *Anchor = (uint8_t *)(((uintptr_t)Anchor_base & ~2047) + 2048); + uint8_t *Anchor = (uint8_t *)(((uintptr_t)Anchor_base & ~((uintptr_t)2047)) + 2048); uint32_t lbnum, MVDS_location, MVDS_length; uint16_t TagID; uint32_t lastsector; @@ -719,7 +719,7 @@ static int UDFFindPartition( dvd_reader_t *device, int partnum, struct Partition *part ) { uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ]; - uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~2047) + 2048); + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048); uint32_t lbnum, MVDS_location, MVDS_length; uint16_t TagID; int i, volvalid; @@ -782,7 +782,7 @@ uint32_t UDFFindFile( dvd_reader_t *device, char *filename, uint32_t *filesize ) { uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ]; - uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~2047) + 2048); + uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048); uint32_t lbnum; uint16_t TagID; struct Partition partition; @@ -927,7 +927,7 @@ static int UDFGetDescriptor( dvd_reader_t *device, int id, static int UDFGetPVD(dvd_reader_t *device, struct pvd_t *pvd) { uint8_t pvd_buf_base[DVD_VIDEO_LB_LEN + 2048]; - uint8_t *pvd_buf = (uint8_t *)(((uintptr_t)pvd_buf_base & ~2047) + 2048); + uint8_t *pvd_buf = (uint8_t *)(((uintptr_t)pvd_buf_base & ~((uintptr_t)2047)) + 2048); if(GetUDFCache(device, PVDCache, 0, pvd)) { return 1; diff --git a/src/input/libdvdnav/read_cache.c b/src/input/libdvdnav/read_cache.c index 70685e2bd..c17e38634 100644 --- a/src/input/libdvdnav/read_cache.c +++ b/src/input/libdvdnav/read_cache.c @@ -17,7 +17,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: read_cache.c,v 1.10 2003/08/25 14:32:37 mroi Exp $ + * $Id: read_cache.c,v 1.11 2004/02/19 02:50:25 rockyb Exp $ * */ @@ -448,7 +448,7 @@ void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count) self->chunk[use].cache_buffer_base = realloc(self->chunk[use].cache_buffer_base, block_count * DVD_VIDEO_LB_LEN + ALIGNMENT); self->chunk[use].cache_buffer = - (uint8_t *)(((uintptr_t)self->chunk[use].cache_buffer_base & ~(ALIGNMENT - 1)) + ALIGNMENT); + (uint8_t *)(((uintptr_t)self->chunk[use].cache_buffer_base & ~((uintptr_t)(ALIGNMENT - 1))) + ALIGNMENT); dprintf("pre_cache DVD read realloc happened\n"); self->chunk[use].cache_malloc_size = block_count; } else { @@ -466,7 +466,7 @@ void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count) self->chunk[i].cache_buffer_base = malloc((block_count > 500 ? block_count : 500) * DVD_VIDEO_LB_LEN + ALIGNMENT); self->chunk[i].cache_buffer = - (uint8_t *)(((uintptr_t)self->chunk[i].cache_buffer_base & ~(ALIGNMENT - 1)) + ALIGNMENT); + (uint8_t *)(((uintptr_t)self->chunk[i].cache_buffer_base & ~((uintptr_t)(ALIGNMENT - 1))) + ALIGNMENT); self->chunk[i].cache_malloc_size = block_count > 500 ? block_count : 500; dprintf("pre_cache DVD read malloc %d blocks\n", (block_count > 500 ? block_count : 500 )); diff --git a/src/libxineadec/nosefart/memguard.c b/src/libxineadec/nosefart/memguard.c index 05d0cb91d..2b29b7d0c 100644 --- a/src/libxineadec/nosefart/memguard.c +++ b/src/libxineadec/nosefart/memguard.c @@ -22,7 +22,7 @@ ** memory allocation wrapper routines ** ** NOTE: based on code (c) 1998 the Retrocade group -** $Id: memguard.c,v 1.2 2003/12/05 15:55:01 f1rmb Exp $ +** $Id: memguard.c,v 1.3 2004/02/19 02:50:25 rockyb Exp $ */ #include "types.h" @@ -33,6 +33,7 @@ #include #include +#include #include "memguard.h" #include "log.h" @@ -271,7 +272,7 @@ void _my_free(void **data) char fail[256]; if (NULL == data || NULL == *data - || 0xFFFFFFFF == (uint32) *data || 0xFFFFFFFF == (uint32) data) + || ((uintptr_t)-1) == (uintptr_t) *data || ((uintptr_t)-1) == (uintptr_t) data) { #ifdef NOFRENDO_DEBUG sprintf(fail, "free: attempted to free NULL pointer at line %d of %s\n", @@ -363,6 +364,30 @@ void mem_checkblocks(void) /* ** $Log: memguard.c,v $ +** Revision 1.3 2004/02/19 02:50:25 rockyb +** Mandrake patches from +** http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/SPECS/xine-lib/ +** via Goetz Waschk who reports: +** +** The amd64 patch (xine-lib-1-rc0a-amd64.patch) sets some conservative +** CFLAGS for amd64, +** +** the lib64 patch (xine-lib-1-rc0a-lib64.patch) replaces hardcoded +** /lib to support the lib64 library dir on amd64, +** +** the directfb patch (xine-lib-1-rc2-no-directfb.patch) adds a +** configure option to disable directfb, +** +** the linuxfb patch (xine-lib-1-rc3a-no-linuxfb.patch) does the same +** for linux framebuffer and +** +** the 64bit fixes patch (xine-lib-1-rc3-64bit-fixes.patch) doesn't +** apply at the moment against the CVS -- demux_ogg.c was not applied. +** it includes some 64 bit pointer and other fixes for 64bit architectures. +** from Gwenole Beauchesne +** +** I haven't tested other than apply and compile. +** ** Revision 1.2 2003/12/05 15:55:01 f1rmb ** cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued... ** diff --git a/src/post/goom/filters.c b/src/post/goom/filters.c index 47c42751e..5cc5e1af0 100644 --- a/src/post/goom/filters.c +++ b/src/post/goom/filters.c @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef HAVE_MMX #define USE_ASM @@ -559,15 +560,15 @@ zoomFilterFastRGB (Uint * pix1, freebrutS = (unsigned int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int)); - brutS = (guint32 *) ((1 + ((unsigned int) (freebrutS)) / 128) * 128); + brutS = (guint32 *) ((1 + ((uintptr_t) (freebrutS)) / 128) * 128); freebrutD = (unsigned int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int)); - brutD = (guint32 *) ((1 + ((unsigned int) (freebrutD)) / 128) * 128); + brutD = (guint32 *) ((1 + ((uintptr_t) (freebrutD)) / 128) * 128); freebrutT = (unsigned int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int)); - brutT = (guint32 *) ((1 + ((unsigned int) (freebrutT)) / 128) * 128); + brutT = (guint32 *) ((1 + ((uintptr_t) (freebrutT)) / 128) * 128); /** modif here by jeko : plus de multiplications **/ { diff --git a/src/post/goom/goom_core.c b/src/post/goom/goom_core.c index e14513156..c2a901780 100644 --- a/src/post/goom/goom_core.c +++ b/src/post/goom/goom_core.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "goom_core.h" #include "goom_tools.h" #include "filters.h" @@ -107,8 +108,8 @@ goom_init (guint32 resx, guint32 resy, int cinemascope) cycle = 0; - p1 = (guint32 *) ((1 + ((unsigned int) (pixel)) / 128) * 128); - p2 = (guint32 *) ((1 + ((unsigned int) (back)) / 128) * 128); + p1 = (guint32 *) ((1 + ((uintptr_t) (pixel)) / 128) * 128); + p2 = (guint32 *) ((1 + ((uintptr_t) (back)) / 128) * 128); init_ifs (resx, c_resoly); gmline1 = goom_lines_init (resx, c_resoly, @@ -149,8 +150,8 @@ goom_set_resolution (guint32 resx, guint32 resy, int cinemascope) bzero (pixel, buffsize * sizeof (guint32) + 128); back = (guint32 *) malloc (buffsize * sizeof (guint32) + 128); bzero (back, buffsize * sizeof (guint32) + 128); - p1 = (guint32 *) ((1 + ((unsigned int) (pixel)) / 128) * 128); - p2 = (guint32 *) ((1 + ((unsigned int) (back)) / 128) * 128); + p1 = (guint32 *) ((1 + ((uintptr_t) (pixel)) / 128) * 128); + p2 = (guint32 *) ((1 + ((uintptr_t) (back)) / 128) * 128); init_ifs (resx, c_resoly); goom_lines_set_res (gmline1, resx, c_resoly); diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c index f640fa38a..cbedf3ec8 100644 --- a/src/video_out/alphablend.c +++ b/src/video_out/alphablend.c @@ -944,7 +944,12 @@ void blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl, int x, y; int l; int clip_right; - uint32_t yuy2; + union { + uint32_t value; + uint8_t b[4]; + uint16_t h[2]; + } yuy2; + uint8_t clr = 0; uint8_t *dst_y = dst_img + dst_pitch * y_off + 2 * x_off; @@ -1078,34 +1083,34 @@ void blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl, if (o) { l = rle_this_bite>>1; if( !((x_off+x) & 1) ) { - *(((uint8_t *)&yuy2) + 0) = my_clut[clr].y; - *(((uint8_t *)&yuy2) + 1) = my_clut[clr].cb; - *(((uint8_t *)&yuy2) + 2) = my_clut[clr].y; - *(((uint8_t *)&yuy2) + 3) = my_clut[clr].cr; + yuy2.b[0] = my_clut[clr].y; + yuy2.b[1] = my_clut[clr].cb; + yuy2.b[2] = my_clut[clr].y; + yuy2.b[3] = my_clut[clr].cr; } else { - *(((uint8_t *)&yuy2) + 0) = my_clut[clr].y; - *(((uint8_t *)&yuy2) + 1) = my_clut[clr].cr; - *(((uint8_t *)&yuy2) + 2) = my_clut[clr].y; - *(((uint8_t *)&yuy2) + 3) = my_clut[clr].cb; + yuy2.b[0] = my_clut[clr].y; + yuy2.b[1] = my_clut[clr].cr; + yuy2.b[2] = my_clut[clr].y; + yuy2.b[3] = my_clut[clr].cb; } if (o >= 15) { while(l--) { - *((uint16_t *)dst)++ = *(((uint16_t *)&yuy2) + 0); - *((uint16_t *)dst)++ = *(((uint16_t *)&yuy2) + 1); + *((uint16_t *)dst)++ = yuy2.h[0]; + *((uint16_t *)dst)++ = yuy2.h[1]; } if(rle_this_bite & 1) - *((uint16_t *)dst)++ = *(((uint16_t *)&yuy2) + 0); + *((uint16_t *)dst)++ = yuy2.h[0]; } else { if( l ) { - mem_blend32(dst, (uint8_t *)&yuy2, o, l); + mem_blend32(dst, &yuy2.b[0], o, l); dst += 4*l; } if(rle_this_bite & 1) { - *dst = BLEND_BYTE(*dst, *(((uint8_t *)&yuy2) + 0), o); + *dst = BLEND_BYTE(*dst, yuy2.b[0], o); dst++; - *dst = BLEND_BYTE(*dst, *(((uint8_t *)&yuy2) + 1), o); + *dst = BLEND_BYTE(*dst, yuy2.b[1], o); dst++; } } diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c index 817ccecde..d959f7a8d 100644 --- a/src/video_out/yuv2rgb.c +++ b/src/video_out/yuv2rgb.c @@ -23,7 +23,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: yuv2rgb.c,v 1.48 2003/12/06 18:11:56 mroi Exp $ + * $Id: yuv2rgb.c,v 1.49 2004/02/19 02:50:26 rockyb Exp $ */ #include "config.h" @@ -68,7 +68,7 @@ static void *my_malloc_aligned (size_t alignment, size_t size, void **chunk) { *chunk = pMem; - while ((int) pMem % alignment) + while ((uintptr_t) pMem % alignment) pMem++; return pMem; diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index acf96cab7..708efc222 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -17,7 +17,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: metronom.c,v 1.135 2004/02/16 20:19:09 uid86226 Exp $ + * $Id: metronom.c,v 1.136 2004/02/19 02:50:26 rockyb Exp $ */ #ifdef HAVE_CONFIG_H @@ -204,7 +204,7 @@ static scr_plugin_t* unixscr_init () { static void metronom_start_clock (metronom_clock_t *this, int64_t pts) { scr_plugin_t** scr; - lprintf("start_clock (at %lld)\n", pts); + lprintf("start_clock (at %" PRId64 ")\n", pts); for (scr = this->scr_list; scr < this->scr_list+MAX_SCR_PROVIDERS; scr++) if (*scr) (*scr)->start(*scr, pts); @@ -260,7 +260,7 @@ static void metronom_set_audio_rate (metronom_t *this, int64_t pts_per_smpls) { pthread_mutex_unlock (&this->lock); - lprintf("%lld pts per %d samples\n", pts_per_smpls, AUDIO_SAMPLE_NUM); + lprintf("%" PRId64 " pts per %d samples\n", pts_per_smpls, AUDIO_SAMPLE_NUM); } static int64_t metronom_got_spu_packet (metronom_t *this, int64_t pts) { @@ -314,7 +314,7 @@ static void metronom_handle_discontinuity (metronom_t *this, int type, this->force_video_jump = 1; this->video_drift = 0; xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "vpts adjusted with prebuffer to %lld\n", this->video_vpts); + "vpts adjusted with prebuffer to %" PRId64 "\n", this->video_vpts); break; case DISC_ABSOLUTE: @@ -332,7 +332,7 @@ static void metronom_handle_discontinuity (metronom_t *this, int type, this->force_video_jump = 1; this->force_audio_jump = 1; this->video_drift = 0; - xprintf(this->xine, XINE_VERBOSITY_DEBUG, "vpts adjusted with prebuffer to %lld\n", + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "vpts adjusted with prebuffer to %" PRId64 "\n", this->video_vpts); } } else { @@ -348,7 +348,7 @@ static void metronom_handle_discontinuity (metronom_t *this, int type, break; } - lprintf("video_vpts: %lld, audio_vpts: %lld\n", this->video_vpts, this->audio_vpts); + lprintf("video_vpts: %" PRId64 ", audio_vpts: %" PRId64 "\n", this->video_vpts, this->audio_vpts); /* vpts_offset adjustements */ switch (type) { @@ -388,7 +388,7 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type, this->video_discontinuity_count++; pthread_cond_signal (&this->video_discontinuity_reached); - xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video discontinuity #%d, type is %d, disc_off %lld\n", + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video discontinuity #%d, type is %d, disc_off %" PRId64 "\n", this->video_discontinuity_count, type, disc_off); if (this->have_audio) { @@ -449,7 +449,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { return; } - lprintf("got_video_frame pts = %lld, duration = %d\n", pts, img->duration); + lprintf("got_video_frame pts = %" PRId64 ", duration = %d\n", pts, img->duration); this->img_cpt++; @@ -462,7 +462,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { if (!img->duration) { if (this->last_video_pts && this->img_cpt) { this->img_duration = (pts - this->last_video_pts) / this->img_cpt; - lprintf("computed frame_duration = %lld\n", this->img_duration ); + lprintf("computed frame_duration = %" PRId64 "\n", this->img_duration ); } img->duration = this->img_duration; } else { @@ -483,7 +483,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { diff = this->video_vpts - vpts; - lprintf("video diff is %lld (predicted %lld, given %lld)\n", diff, this->video_vpts, vpts); + lprintf("video diff is %" PRId64 " (predicted %" PRId64 ", given %" PRId64 ")\n", diff, this->video_vpts, vpts); if ((abs (diff) > VIDEO_DRIFT_TOLERANCE) || (this->force_video_jump)) { this->force_video_jump = 0; @@ -499,7 +499,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { /* this will fix video drift with a constant compensation each frame for about 1 second of video. */ - if (diff) lprintf("video drift, drift is %lld\n", this->video_drift); + if (diff) lprintf("video drift, drift is %" PRId64 "\n", this->video_drift); } } else { if (!img->duration) { @@ -512,7 +512,7 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) { img->vpts = this->video_vpts + this->av_offset; - lprintf("video vpts for %10lld : %10lld (duration:%d drift:%lld step:%lld)\n", + lprintf("video vpts for %10lld : %10lld (duration:%d drift:%" PRId64 " step:%" PRId64 ")\n", pts, this->video_vpts, img->duration, this->video_drift, this->video_drift_step ); if( this->video_drift * this->video_drift_step > 0 ) @@ -541,7 +541,7 @@ static void metronom_handle_audio_discontinuity (metronom_t *this, int type, this->audio_discontinuity_count++; pthread_cond_signal (&this->audio_discontinuity_reached); - xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio discontinuity #%d, type is %d, disc_off %lld\n", + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio discontinuity #%d, type is %d, disc_off %" PRId64 "\n", this->audio_discontinuity_count, type, disc_off); if (this->have_video) { @@ -571,8 +571,8 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts, int64_t vpts; int64_t diff; - lprintf("got %d audio samples, pts is %lld, last pts = %lld\n", nsamples, pts, this->last_audio_pts); - lprintf("AUDIO pts from last= %lld\n", pts-this->last_audio_pts); + lprintf("got %d audio samples, pts is %" PRId64 ", last pts = %" PRId64 "\n", nsamples, pts, this->last_audio_pts); + lprintf("AUDIO pts from last= %" PRId64 "\n", pts-this->last_audio_pts); pthread_mutex_lock (&this->lock); @@ -616,11 +616,11 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts, this->force_audio_jump = 0; this->audio_vpts = vpts; this->audio_drift_step = 0; - xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio jump, diff=%lld\n", diff); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio jump, diff=%" PRId64 "\n", diff); } else { if( this->audio_samples ) { /* calculate drift_step to recover vpts errors */ - lprintf("audio diff = %lld \n", diff ); + lprintf("audio diff = %" PRId64 " \n", diff ); diff *= AUDIO_SAMPLE_NUM; diff /= this->audio_samples * 4; @@ -633,7 +633,7 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts, this->audio_drift_step = diff; - lprintf("audio_drift = %lld, pts_per_smpls = %lld\n", diff, this->pts_per_smpls); + lprintf("audio_drift = %" PRId64 ", pts_per_smpls = %" PRId64 "\n", diff, this->pts_per_smpls); } } this->audio_samples = 0; @@ -671,11 +671,11 @@ static void metronom_set_option (metronom_t *this, int option, int64_t value) { switch (option) { case METRONOM_AV_OFFSET: this->av_offset = value; - xprintf(this->xine, XINE_VERBOSITY_LOG, "av_offset=%lld pts\n", this->av_offset); + xprintf(this->xine, XINE_VERBOSITY_LOG, "av_offset=%" PRId64 " pts\n", this->av_offset); break; case METRONOM_SPU_OFFSET: this->spu_offset = value; - xprintf(this->xine, XINE_VERBOSITY_LOG, "spu_offset=%lld pts\n", this->spu_offset); + xprintf(this->xine, XINE_VERBOSITY_LOG, "spu_offset=%" PRId64 " pts\n", this->spu_offset); break; case METRONOM_ADJ_VPTS_OFFSET: this->audio_vpts += value; @@ -685,11 +685,11 @@ static void metronom_set_option (metronom_t *this, int option, int64_t value) { * once in a while means a small sound card drift (or system * clock drift -- who knows?). nothing to worry about. */ - xprintf(this->xine, XINE_VERBOSITY_LOG, "fixing sound card drift by %lld pts\n", value); + xprintf(this->xine, XINE_VERBOSITY_LOG, "fixing sound card drift by %" PRId64 " pts\n", value); break; case METRONOM_PREBUFFER: this->prebuffer = value; - xprintf(this->xine, XINE_VERBOSITY_LOG, "prebuffer=%lld pts\n", this->prebuffer); + xprintf(this->xine, XINE_VERBOSITY_LOG, "prebuffer=%" PRId64 " pts\n", this->prebuffer); break; default: xprintf(this->xine, XINE_VERBOSITY_NONE, "unknown option in set_option: %d\n", option); diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index c23ceb651..706dfeb80 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -17,7 +17,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: video_out.c,v 1.185 2004/01/07 22:22:54 jstembridge Exp $ + * $Id: video_out.c,v 1.186 2004/02/19 02:50:26 rockyb Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -34,6 +34,7 @@ #include #include #include +#include #include #define XINE_ENABLE_EXPERIMENTAL_FEATURES @@ -344,7 +345,7 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { cur_vpts = this->clock->get_current_time(this->clock); this->last_delivery_pts = cur_vpts; - lprintf ("got image at master vpts %lld. vpts for picture is %lld (pts was %lld)\n", + lprintf ("got image oat master vpts %" PRId64 ". vpts for picture is %" PRId64 " (pts was %" PRId64 ")\n", cur_vpts, pic_vpts, img->pts); this->num_frames_delivered++; @@ -385,7 +386,7 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { } - lprintf ("delivery diff : %lld, current vpts is %lld, %d frames to skip\n", + lprintf ("delivery diff : %" PRId64 ", current vpts is %" PRId64 ", %d frames to skip\n", diff, cur_vpts, frames_to_skip); if (!img->bad_frame) { @@ -629,7 +630,7 @@ static void expire_frames (vos_t *this, int64_t cur_vpts) { if( !this->discard_frames ) { xine_log(this->xine, XINE_LOG_MSG, - _("video_out: throwing away image with pts %lld because it's too old (diff : %lld).\n"), pts, diff); + _("video_out: throwing away image with pts %" PRId64 " because it's too old (diff : %" PRId64 ").\n"), pts, diff); this->num_frames_discarded++; } @@ -705,7 +706,7 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { if (this->img_backup && (this->redraw_needed==1)) { - lprintf("generating still frame (cur_vpts = %lld) \n", cur_vpts); + lprintf("generating still frame (cur_vpts = %" PRId64 ") \n", cur_vpts); /* keep playing still frames */ pthread_mutex_lock( &this->free_img_buf_queue->mutex ); @@ -738,7 +739,7 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { * time to display frame "img" ? */ - lprintf ("diff %lld\n", diff); + lprintf ("diff %" PRId64 "\n", diff); if (diff < 0) { pthread_mutex_unlock(&this->display_img_buf_queue->mutex); @@ -784,7 +785,7 @@ static void overlay_and_display_frame (vos_t *this, vo_frame_t *img, int64_t vpts) { xine_stream_t *stream; - lprintf ("displaying image with vpts = %lld\n", img->vpts); + lprintf ("displaying image with vpts = %" PRId64 "\n", img->vpts); /* no, this is not were proc_*() is usually called. * it's just to catch special cases like late or duplicated frames. @@ -939,7 +940,7 @@ static void *video_out_loop (void *this_gen) { vpts = this->clock->get_current_time (this->clock); - lprintf ("loop iteration at %lld\n", vpts); + lprintf ("loop iteration at %" PRId64 "\n", vpts); expire_frames (this, vpts); img = get_next_frame (this, vpts); @@ -1000,7 +1001,7 @@ static void *video_out_loop (void *this_gen) { next_frame_vpts += 1000; } - lprintf ("next_frame_vpts is %lld\n", next_frame_vpts); + lprintf ("next_frame_vpts is %" PRId64 "\n", next_frame_vpts); do { vpts = this->clock->get_current_time (this->clock); @@ -1010,11 +1011,11 @@ static void *video_out_loop (void *this_gen) { usec_to_sleep = (next_frame_vpts - vpts) * 100 / 9; - lprintf ("%lld usec to sleep at master vpts %lld\n", usec_to_sleep, vpts); + lprintf ("%" PRId64 " usec to sleep at master vpts %" PRId64 "\n", usec_to_sleep, vpts); if ( (next_frame_vpts - vpts) > 2*90000 ) xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out: vpts/clock error, next_vpts=%lld cur_vpts=%lld\n", next_frame_vpts,vpts); + "video_out: vpts/clock error, next_vpts=%" PRId64 " cur_vpts=%" PRId64 "\n", next_frame_vpts,vpts); if (usec_to_sleep>0) xine_usec_sleep (usec_to_sleep); -- cgit v1.2.3