From e984f917fbbc37874f55c6aff3239831cb43d1ec Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Sat, 6 Dec 2003 18:11:53 +0000 Subject: reading through Daniel's huge patch was quite tiresome, but it was not worthless: * fixing some lprintf's * fixing one printf -> xprintf * adding patch to diff_to_ffmpeg_cvs * small addition to xineutils.h (some gcc magic for future optimizations) CVS patchset: 5853 CVS date: 2003/12/06 18:11:53 --- src/libffmpeg/diff_to_ffmpeg_cvs.txt | 11 +++++++++++ src/video_out/deinterlace.c | 6 +++--- src/video_out/video_out_xvmc.c | 4 ++-- src/video_out/yuv2rgb.c | 10 +++++----- src/xine-engine/lrb.c | 6 +++--- src/xine-utils/xine_buffer.c | 24 ++++++++++++------------ src/xine-utils/xineutils.h | 24 ++++++++++++++++-------- src/xine-utils/xmllexer.c | 12 ++++++------ src/xine-utils/xmlparser.c | 26 +++++++++++++------------- 9 files changed, 71 insertions(+), 52 deletions(-) diff --git a/src/libffmpeg/diff_to_ffmpeg_cvs.txt b/src/libffmpeg/diff_to_ffmpeg_cvs.txt index abed38ce8..dc4d9924e 100644 --- a/src/libffmpeg/diff_to_ffmpeg_cvs.txt +++ b/src/libffmpeg/diff_to_ffmpeg_cvs.txt @@ -142,6 +142,17 @@ +#define memcpy(a,b,c) xine_fast_memcpy(a,b,c) + +#endif +--- libavcodec/h263.c 2003-11-16 16:02:21.000000000 +0100 ++++ libavcodec/h263.c 2003-12-06 16:53:35.000000000 +0100 +@@ -5097,7 +5097,7 @@ + /* detect buggy encoders which dont set the low_delay flag (divx4/xvid/opendivx)*/ + // note we cannot detect divx5 without b-frames easyly (allthough its buggy too) + if(s->vo_type==0 && s->vol_control_parameters==0 && s->divx_version==0 && s->picture_number==0){ +- printf("looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n"); ++ //printf("looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n"); + s->low_delay=1; + } + --- libavcodec/i386/cputest.c 2003-11-01 18:43:19.000000000 +0100 +++ libavcodec/i386/cputest.c 2003-07-02 16:36:41.000000000 +0200 @@ -1,122 +1,13 @@ diff --git a/src/video_out/deinterlace.c b/src/video_out/deinterlace.c index d08346cfc..347185b2f 100644 --- a/src/video_out/deinterlace.c +++ b/src/video_out/deinterlace.c @@ -811,7 +811,7 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[], xine_fast_memcpy(pdst,psrc[0],width*height); break; case DEINTERLACE_ONEFIELDXV: - lprintf("deinterlace: ONEFIELDXV must be handled by the video driver.\n"); + lprintf("ONEFIELDXV must be handled by the video driver.\n"); break; case DEINTERLACE_LINEARBLEND: if( check_for_mmx() ) @@ -820,7 +820,7 @@ void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc[], deinterlace_linearblend_yuv(pdst,psrc,width,height); break; default: - lprintf("deinterlace: unknow method %d.\n",method); + lprintf("unknow method %d.\n",method); break; } } @@ -836,7 +836,7 @@ int deinterlace_yuv_supported ( int method ) case DEINTERLACE_ONEFIELD: return check_for_mmx(); case DEINTERLACE_ONEFIELDXV: - lprintf ("deinterlace: ONEFIELDXV must be handled by the video driver.\n"); + lprintf ("ONEFIELDXV must be handled by the video driver.\n"); return 0; case DEINTERLACE_LINEARBLEND: return 1; diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 9708c8179..7b1ec62f9 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.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_xvmc.c,v 1.10 2003/12/05 15:55:04 f1rmb Exp $ + * $Id: video_out_xvmc.c,v 1.11 2003/12/06 18:11:56 mroi Exp $ * * video_out_xvmc.c, X11 video motion compensation extension interface for xine * @@ -694,7 +694,7 @@ static cxid_t *xvmc_set_context (xvmc_driver_t *this, result =XvMCCreateMacroBlocks(this->display, &this->context, slices, macroblocks->macro_blocks); if(result != Success) { - printf(this->xine, XINE_VERBOSITY_DEBUG, "set_context: ERROR XvMCCreateMacroBlocks failed\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "set_context: ERROR XvMCCreateMacroBlocks failed\n"); macroblocks->xine_mc.xvmc_accel = 0; abort(); } diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c index 57b76867c..817ccecde 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.47 2003/12/05 15:55:04 f1rmb Exp $ + * $Id: yuv2rgb.c,v 1.48 2003/12/06 18:11:56 mroi Exp $ */ #include "config.h" @@ -2397,7 +2397,7 @@ static void yuv2rgb_set_csc_levels (yuv2rgb_factory_t *this, default: - lprintf ("yuv2rgb: mode %d not supported by yuv2rgb\n", mode); + lprintf ("mode %d not supported by yuv2rgb\n", mode); abort(); } @@ -2529,7 +2529,7 @@ static void yuv2rgb_c_init (yuv2rgb_factory_t *this) break; default: - lprintf ("yuv2rgb: mode %d not supported by yuv2rgb\n", this->mode); + lprintf ("mode %d not supported by yuv2rgb\n", this->mode); abort(); } @@ -2572,7 +2572,7 @@ static void yuv2rgb_single_pixel_init (yuv2rgb_factory_t *this) { break; default: - lprintf ("yuv2rgb: mode %d not supported by yuv2rgb\n", this->mode); + lprintf ("mode %d not supported by yuv2rgb\n", this->mode); abort(); } } @@ -3114,7 +3114,7 @@ static void yuy22rgb_c_init (yuv2rgb_factory_t *this) break; default: - lprintf ("yuv2rgb: mode %d not supported for yuy2\n", this->mode); + lprintf ("mode %d not supported for yuy2\n", this->mode); } } diff --git a/src/xine-engine/lrb.c b/src/xine-engine/lrb.c index c13a4dee1..3f7189fad 100644 --- a/src/xine-engine/lrb.c +++ b/src/xine-engine/lrb.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: lrb.c,v 1.5 2003/12/05 15:55:04 f1rmb Exp $ + * $Id: lrb.c,v 1.6 2003/12/06 18:11:56 mroi Exp $ * */ @@ -79,7 +79,7 @@ void lrb_add (lrb_t *this, buf_element_t *buf) { this->cur_num_entries++; } - lprintf ("lrb: %d elements in buffer\n", this->cur_num_entries); + lprintf ("%d elements in buffer\n", this->cur_num_entries); } @@ -106,7 +106,7 @@ void lrb_feedback (lrb_t *this, fifo_buffer_t *fifo) { this->cur_num_entries--; - lprintf ("lrb: feedback\n"); + lprintf ("feedback\n"); } diff --git a/src/xine-utils/xine_buffer.c b/src/xine-utils/xine_buffer.c index d99adbc49..e69a36c04 100644 --- a/src/xine-utils/xine_buffer.c +++ b/src/xine-utils/xine_buffer.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: xine_buffer.c,v 1.6 2003/12/05 15:55:05 f1rmb Exp $ + * $Id: xine_buffer.c,v 1.7 2003/12/06 18:11:55 mroi Exp $ * * * generic dynamic buffer functions. The goals @@ -138,7 +138,7 @@ void *_xine_buffer_free(void *buf) { #ifdef CHECKS if (!buf) { - lprintf("xine_buffer_free: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return NULL; } CHECK_MAGIC(buf); @@ -158,7 +158,7 @@ void *xine_buffer_dup(void *buf) { #ifdef CHECKS if (!buf) { - lprintf("xine_buffer_dup: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return NULL; } CHECK_MAGIC(buf); @@ -181,7 +181,7 @@ void *_xine_buffer_copyin(void *buf, int index, const void *data, int len) { #ifdef CHECKS if (!buf || !data) { - lprintf("xine_buffer_copyin: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return NULL; } CHECK_MAGIC(buf); @@ -203,7 +203,7 @@ void xine_buffer_copyout(void *buf, int index, void *data, int len) { #ifdef CHECKS if (!buf || !data) { - lprintf("xine_buffer_copyout: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return; } CHECK_MAGIC(buf); @@ -211,7 +211,7 @@ void xine_buffer_copyout(void *buf, int index, void *data, int len) { if (GET_HEADER(buf)->size < index+len) { - lprintf("xine_buffer_copyout: warning: attempt to read over boundary!\n"); + lprintf("warning: attempt to read over boundary!\n"); if (GET_HEADER(buf)->size < index) return; len = GET_HEADER(buf)->size - index; @@ -228,7 +228,7 @@ void *_xine_buffer_set(void *buf, int index, uint8_t b, int len) { #ifdef CHECKS if (!buf) { - lprintf("xine_buffer_set: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return NULL; } CHECK_MAGIC(buf); @@ -251,7 +251,7 @@ void *_xine_buffer_strcat(void *buf, char *data) { #ifdef CHECKS if (!buf || !data) { - lprintf("xine_buffer_strcat: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return NULL; } CHECK_MAGIC(buf); @@ -273,7 +273,7 @@ void *_xine_buffer_strcpy(void *buf, int index, char *data) { #ifdef CHECKS if (!buf || !data) { - lprintf("xine_buffer_strcpy: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return NULL; } CHECK_MAGIC(buf); @@ -294,7 +294,7 @@ void *_xine_buffer_strcpy(void *buf, int index, char *data) { char *xine_buffer_strchr(void *buf, int ch) { #ifdef CHECKS if (!buf) { - lprintf("xine_buffer_get_size: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return 0; } CHECK_MAGIC(buf); @@ -310,7 +310,7 @@ int xine_buffer_get_size(void *buf) { #ifdef CHECKS if (!buf) { - lprintf("xine_buffer_get_size: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return 0; } CHECK_MAGIC(buf); @@ -330,7 +330,7 @@ void *_xine_buffer_ensure_size(void *buf, int size) { #ifdef CHECKS if (!buf) { - lprintf("xine_buffer_ensure_size: warning: got NULL pointer\n"); + lprintf("warning: got NULL pointer\n"); return 0; } CHECK_MAGIC(buf); diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 989a4b9cb..74b419b4b 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -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: xineutils.h,v 1.68 2003/12/05 15:55:05 f1rmb Exp $ + * $Id: xineutils.h,v 1.69 2003/12/06 18:11:55 mroi Exp $ * */ #ifndef XINEUTILS_H @@ -585,7 +585,7 @@ typedef union { TODO : fix dll linkage problem for xine_fast_memcpy on win32 xine_fast_memcpy dll linkage is screwy here. - declairing as dllinport seems to fix the problem + declairing as dllimport seems to fix the problem but causes compiler warning with libxineutils */ #ifdef _MSC_VER @@ -833,6 +833,17 @@ void xine_hexdump (const char *buf, int length); /* backtrace printout funtion for use in XINE_ASSERT() macro */ void xine_print_trace(void); +/* + * Optimization macros for conditions + * Taken from the FIASCO L4 microkernel sources + */ +#if !defined(__GNUC__) || __GNUC__ < 3 +# define EXPECT_TRUE(x) (x) +# define EXPECT_FALSE(x) (x) +#else +# define EXPECT_TRUE(x) __builtin_expect((x),1) +# define EXPECT_FALSE(x) __builtin_expect((x),0) +#endif #ifdef DEBUG # define XINE_ABORT() \ @@ -973,8 +984,7 @@ void xine_print_trace(void); #ifdef __GNUC__ #define xprintf(xine, verbose, fmt, args...) \ do { \ - if((xine)->verbosity >= verbose){ \ - LOG_MODULE_STRING \ + if((xine) && (xine)->verbosity >= verbose){ \ xine_log(xine, XINE_LOG_TRACE, fmt, ##args); \ } \ } while(0) @@ -982,16 +992,14 @@ void xine_print_trace(void); #ifdef _MSC_VER #define xprintf(xine, verbose, fmtargs) \ do { \ - if((xine)->verbosity >= verbose){ \ - LOG_MODULE_STRING \ + if((xine) && (xine)->verbosity >= verbose){ \ xine_log(xine, XINE_LOG_TRACE, fmtargs); \ } \ } while(0) #else #define xprintf(xine, verbose, ...) \ do { \ - if((xine)->verbosity >= verbose){ \ - LOG_MODULE_STRING \ + if((xine) && (xine)->verbosity >= verbose){ \ xine_log(xine, XINE_LOG_TRACE, __VA_ARGS__); \ } \ } while(0) diff --git a/src/xine-utils/xmllexer.c b/src/xine-utils/xmllexer.c index f41dbbdc6..b72865e07 100644 --- a/src/xine-utils/xmllexer.c +++ b/src/xine-utils/xmllexer.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: xmllexer.c,v 1.5 2003/12/05 15:55:05 f1rmb Exp $ + * $Id: xmllexer.c,v 1.6 2003/12/06 18:11:55 mroi Exp $ * */ @@ -347,7 +347,7 @@ int lexer_get_token(char * tok, int tok_size) { } break; default: - lprintf("xmllexer: expected char \'%c\'\n", tok[tok_pos - 1]); /* FIX ME */ + lprintf("expected char \'%c\'\n", tok[tok_pos - 1]); /* FIX ME */ return T_ERROR; } } else { @@ -368,7 +368,7 @@ int lexer_get_token(char * tok, int tok_size) { /* pb */ if (tok_pos >= tok_size) { - lprintf("xmllexer: token buffer is too little\n"); + lprintf("token buffer is too little\n"); } else { if (lexbuf_pos >= lexbuf_size) { /* Terminate the current token */ @@ -398,15 +398,15 @@ int lexer_get_token(char * tok, int tok_size) { return T_DATA; break; default: - lprintf("xmllexer: unknown state, state=%d\n", state); + lprintf("unknown state, state=%d\n", state); } } else { - lprintf("xmllexer: abnormal end of buffer, state=%d\n", state); + lprintf("abnormal end of buffer, state=%d\n", state); } } return T_ERROR; } /* tok == null */ - lprintf("xmllexer: token buffer is null\n"); + lprintf("token buffer is null\n"); return T_ERROR; } diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index b232a1931..c36cb849b 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -18,7 +18,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: xmlparser.c,v 1.12 2003/12/05 15:55:05 f1rmb Exp $ + * $Id: xmlparser.c,v 1.13 2003/12/06 18:11:53 mroi Exp $ * */ @@ -209,7 +209,7 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r lprintf("info: node data : %s\n", current_node->data); break; default: - lprintf("xmlparser: error: unexpected token \"%s\", state %d\n", tok, state); + lprintf("error: unexpected token \"%s\", state %d\n", tok, state); return -1; break; } @@ -230,7 +230,7 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r lprintf("info: current node name \"%s\"\n", node_name); break; default: - lprintf("xmlparser: error: unexpected token \"%s\", state %d\n", tok, state); + lprintf("error: unexpected token \"%s\", state %d\n", tok, state); return -1; break; } @@ -296,7 +296,7 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r lprintf("info: current property name \"%s\"\n", property_name); break; default: - lprintf("xmlparser: error: unexpected token \"%s\", state %d\n", tok, state); + lprintf("error: unexpected token \"%s\", state %d\n", tok, state); return -1; break; } @@ -312,12 +312,12 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r if (strcmp(tok, root_name) == 0) { state = 4; } else { - lprintf("xmlparser: error: xml struct, tok=%s, waited_tok=%s\n", tok, root_name); + lprintf("error: xml struct, tok=%s, waited_tok=%s\n", tok, root_name); return -1; } break; default: - lprintf("xmlparser: error: unexpected token \"%s\", state %d\n", tok, state); + lprintf("error: unexpected token \"%s\", state %d\n", tok, state); return -1; break; } @@ -330,7 +330,7 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r return 0; break; default: - lprintf("xmlparser: error: unexpected token \"%s\", state %d\n", tok, state); + lprintf("error: unexpected token \"%s\", state %d\n", tok, state); return -1; break; } @@ -365,7 +365,7 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r state = 2; break; default: - lprintf("xmlparser: error: unexpected token \"%s\", state %d\n", tok, state); + lprintf("error: unexpected token \"%s\", state %d\n", tok, state); return -1; break; } @@ -394,7 +394,7 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r state = 2; break; default: - lprintf("xmlparser: error: unexpected token \"%s\", state %d\n", tok, state); + lprintf("error: unexpected token \"%s\", state %d\n", tok, state); return -1; break; } @@ -438,16 +438,16 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r default: - lprintf("xmlparser: error: unknown parser state, state=%d\n", state); + lprintf("error: unknown parser state, state=%d\n", state); return -1; } } /* lex error */ - lprintf("xmlparser: error: lexer error\n"); + lprintf("error: lexer error\n"); return -1; } else { /* max recursion */ - lprintf("xmlparser: error: max recursion\n"); + lprintf("error: max recursion\n"); return -1; } } @@ -463,7 +463,7 @@ int xml_parser_build_tree(xml_node_t **root_node) { free_xml_node(tmp_node); res = 0; } else { - lprintf("xmlparser: error: xml struct\n"); + lprintf("error: xml struct\n"); xml_parser_free_tree(tmp_node); res = -1; } -- cgit v1.2.3