diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | debian/control | 3 | ||||
-rw-r--r-- | include/xine.h.in | 52 | ||||
-rw-r--r-- | src/audio_out/audio_fusionsound_out.c | 2 | ||||
-rw-r--r-- | src/input/input_dvb.c | 2 | ||||
-rw-r--r-- | src/input/libreal/real.c | 2 | ||||
-rw-r--r-- | src/input/mms.c | 6 | ||||
-rw-r--r-- | src/input/mmsh.c | 4 | ||||
-rw-r--r-- | src/libsputext/demux_sputext.c | 3 | ||||
-rw-r--r-- | src/libw32dll/wine/win32.c | 1 | ||||
-rw-r--r-- | src/video_out/video_out_opengl.c | 4 | ||||
-rw-r--r-- | src/xine-engine/demux.c | 2 | ||||
-rw-r--r-- | src/xine-engine/info_helper.c | 4 | ||||
-rw-r--r-- | src/xine-engine/input_rip.c | 7 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 139 | ||||
-rw-r--r-- | src/xine-engine/xine_interface.c | 2 | ||||
-rw-r--r-- | src/xine-utils/list.c | 2 | ||||
-rw-r--r-- | src/xine-utils/utils.c | 2 | ||||
-rw-r--r-- | src/xine-utils/xmlparser.c | 3 |
19 files changed, 157 insertions, 87 deletions
diff --git a/configure.ac b/configure.ac index 188a0e0d3..671bd0c18 100644 --- a/configure.ac +++ b/configure.ac @@ -53,9 +53,9 @@ dnl are platform dependent dnl * in Linux, the library will be named dnl libname.so.(XINE_LT_CURRENT - XINE_LT_AGE).XINE_LT_AGE.XINE_LT_REVISION -XINE_LT_CURRENT=22 +XINE_LT_CURRENT=23 XINE_LT_REVISION=0 -XINE_LT_AGE=21 +XINE_LT_AGE=22 dnl for a release tarball do "rm .cvsversion" before "make dist" if test -f "${srcdir-.}/.cvsversion"; then diff --git a/debian/control b/debian/control index f83f8f650..f111cd087 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,8 @@ Build-Depends: debhelper (>= 5.0.1), binutils (>= 2.12.90.0.9), pkg-config, libcam-dev [kfreebsd-i386 kfreebsd-amd64], libaa1-dev, libcaca-dev, libmodplug-dev, libjack-dev, libpulse-dev, libartsc0-dev, - libmagick9-dev | libmagick-dev, libpng12-dev, libfreetype6-dev, + libmagick9-dev | libmagick-dev |libmagickwand-dev, + libpng12-dev, libfreetype6-dev, libogg-dev, libvorbis-dev, libtheora-dev, libesd0-dev, libgnomevfs2-dev, liblircclient-dev, diff --git a/include/xine.h.in b/include/xine.h.in index ad79bebc6..1e68a14ce 100644 --- a/include/xine.h.in +++ b/include/xine.h.in @@ -431,8 +431,13 @@ int xine_get_param (xine_stream_t *stream, int param) XINE_PROTECTED; * image data into a too small buffer. * * xine_get_current_frame_alloc() takes care of allocating - * a buffer on it's own, so image data can be retrieved by + * a buffer on its own, so image data can be retrieved by * a single call without the need to pause the stream. + * + * xine_get_current_frame_data() passes the parameters of the + * previously mentioned functions plus further information in + * a structure and can work like the _s or _alloc function + * respectively depending on the passed flags. * * all functions return 1 on success, 0 failure. */ @@ -444,12 +449,33 @@ int xine_get_current_frame (xine_stream_t *stream, int xine_get_current_frame_s (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t *img, int *size) XINE_PROTECTED; + uint8_t *img, int *img_size) XINE_PROTECTED; int xine_get_current_frame_alloc (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t **img, int *size) XINE_PROTECTED; + uint8_t **img, int *img_size) XINE_PROTECTED; + +typedef struct { + + int width; + int height; + int crop_left; + int crop_right; + int crop_top; + int crop_bottom; + int ratio_code; + int interlaced; + int format; + int img_size; + uint8_t *img; +} xine_current_frame_data_t; + +#define XINE_FRAME_DATA_ALLOCATE_IMG (1<<0) + +int xine_get_current_frame_data (xine_stream_t *stream, + xine_current_frame_data_t *data, + int flags) XINE_PROTECTED; /* xine image formats */ #define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y') @@ -1133,7 +1159,7 @@ typedef struct { * * this will be called by the video driver to find out * how big the video output area size will be for a - * given video size. The ui should _not_ adjust it's + * given video size. The ui should _not_ adjust its * video out area, just do some calculations and return * the size. This will be called for every frame, ui * implementation should be fast. @@ -1157,12 +1183,12 @@ typedef struct { * frame output callback * * this will be called by the video driver for every frame - * it's about to draw. ui can adapt it's size if necessary + * it's about to draw. ui can adapt its size if necessary * here. * note: the ui doesn't have to adjust itself to this * size, this is just to be taken as a hint. * ui must return the actual size of the video output - * area and the video output driver will do it's best + * area and the video output driver will do its best * to adjust the video frames to that size (while * preserving aspect ratio and stuff). * dest_x, dest_y: offset inside window @@ -1233,7 +1259,7 @@ typedef struct { * * this will be called by the video driver to find out * how big the video output area size will be for a - * given video size. The ui should _not_ adjust it's + * given video size. The ui should _not_ adjust its * video out area, just do some calculations and return * the size. This will be called for every frame, ui * implementation should be fast. @@ -1257,12 +1283,12 @@ typedef struct { * frame output callback * * this will be called by the video driver for every frame - * it's about to draw. ui can adapt it's size if necessary + * it's about to draw. ui can adapt its size if necessary * here. * note: the ui doesn't have to adjust itself to this * size, this is just to be taken as a hint. * ui must return the actual size of the video output - * area and the video output driver will do it's best + * area and the video output driver will do its best * to adjust the video frames to that size (while * preserving aspect ratio and stuff). * dest_x, dest_y: offset inside window @@ -1319,7 +1345,7 @@ typedef struct { * So a frontend must at least support rgb. * Be aware that rgb requires more cpu than yuv, * so avoid its usage for video playback. - * However, it's usefull for single frame capture (e.g. thumbs) + * However, it's useful for single frame capture (e.g. thumbs) */ int supported_formats; @@ -1618,7 +1644,7 @@ int xine_config_lookup_entry (xine_t *self, const char *key, /* * update a config entry (which was returned from lookup_entry() ) * - * xine will make a deep copy of the data in the entry into it's internal + * xine will make a deep copy of the data in the entry into its internal * config database. */ void xine_config_update_entry (xine_t *self, @@ -2013,8 +2039,8 @@ typedef struct { * This is the mechanism to report async errors from engine. * * If frontend knows about the XINE_MSG_xxx type it may safely - * ignore the 'explanation' field and provide it's own custom - * dialog to the 'parameters'. + * ignore the 'explanation' field and provide its own custom + * dialogue to the 'parameters'. * * right column specifies the usual parameters. */ diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c index 1480cd6d2..6c3a0ae33 100644 --- a/src/audio_out/audio_fusionsound_out.c +++ b/src/audio_out/audio_fusionsound_out.c @@ -389,7 +389,7 @@ static ao_driver_t* open_plugin(audio_driver_class_t *ao_class, fusionsound_class_t *class = (fusionsound_class_t *) ao_class; fusionsound_driver_t *this; const char *args[] = { "xine", "--dfb:no-sighandler", "--fs:no-banner" }; - int argn = sizeof(args) / sizeof(args[0]); + const size_t argn = sizeof(args) / sizeof(args[0]); char **argp = (char **) args; DFBResult ret; diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 9166a80a6..69a413bac 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -1659,7 +1659,7 @@ static void render_text_area(osd_renderer_t* renderer, osd_object_t* osd, char* /* The line to be printed next. */ char text_line[512]; int text_width, text_height; - int old_line_length, line_cursor; + size_t old_line_length, line_cursor; char* bound, *old_bound; *height = 0; diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c index dc3f00105..f4698a4fb 100644 --- a/src/input/libreal/real.c +++ b/src/input/libreal/real.c @@ -313,7 +313,7 @@ static void calc_response_string (char *result, char *challenge) { void real_calc_response_and_checksum (char *response, char *chksum, char *challenge) { - int ch_len, resp_len; + size_t ch_len, resp_len; int i; char *ptr; char buf[128]; diff --git a/src/input/mms.c b/src/input/mms.c index 97a05dd89..ab1983955 100644 --- a/src/input/mms.c +++ b/src/input/mms.c @@ -771,12 +771,10 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) { /* command 0x5 */ { mms_buffer_t command_buffer; - char *path; - int pathlen; + char *path = this->uri; + size_t pathlen = strlen(path); /* remove the first '/' */ - path = this->uri; - pathlen = strlen(path); if (pathlen > 1) { path++; pathlen--; diff --git a/src/input/mmsh.c b/src/input/mmsh.c index 2feb7c37b..4ee7ed07d 100644 --- a/src/input/mmsh.c +++ b/src/input/mmsh.c @@ -190,11 +190,9 @@ struct mmsh_s { }; static int send_command (mmsh_t *this, char *cmd) { - int length; - lprintf ("send_command:\n%s\n", cmd); - length = strlen(cmd); + const size_t length = strlen(cmd); if (_x_io_tcp_write(this->stream, this->s, cmd, length) != length) { xprintf (this->stream->xine, XINE_LOG_MSG, _("libmmsh: send error\n")); return 0; diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index f7cd5af83..741d0612b 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -129,7 +129,6 @@ static int eol(char p) { } static inline void trail_space(char *s) { - int i; while (isspace(*s)) { char *copy = s; do { @@ -137,7 +136,7 @@ static inline void trail_space(char *s) { copy++; } while(*copy); } - i = strlen(s) - 1; + size_t i = strlen(s) - 1; while (i > 0 && isspace(s[i])) s[i--] = '\0'; } diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index f908f1c2e..9d99e1a25 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -3492,6 +3492,7 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2, { int result; char* x=strrchr(cs1,'\\'); + char* tmp; asprintf(&tmp,"%s/%s",win32_def_path,x?(x+1):cs1); // printf("### Open: %s -> %s\n",cs1,tmp); result=open(tmp, O_RDONLY); diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 9dcfd4f2e..af1093e91 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -669,8 +669,8 @@ static int render_image_envtex (opengl_driver_t *this, opengl_frame_t *frame) { * Render setup functions */ static int render_help_verify_ext (opengl_driver_t *this, char *ext) { - int ret = 0; - int l = strlen (ext); + int ret = 0; + const size_t l = strlen (ext); const char *e; for (e = (char *) this->gl_exts; e && *e; e = strchr (e, ' ')) { while (isspace (*e)) diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 51ed5b39d..c116d407f 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -657,7 +657,7 @@ void _x_demux_send_mrl_reference (xine_stream_t *stream, int alternative, xine_mrl_reference_data_ext_t *e; xine_mrl_reference_data_t *b; } data; - int mrl_len = strlen (mrl); + const size_t mrl_len = strlen (mrl); if (!title) title = ""; diff --git a/src/xine-engine/info_helper.c b/src/xine-engine/info_helper.c index e6d4df7e9..242805915 100644 --- a/src/xine-engine/info_helper.c +++ b/src/xine-engine/info_helper.c @@ -131,7 +131,7 @@ uint32_t _x_stream_info_get_public(xine_stream_t *stream, int info) { * at the end of the string */ static void meta_info_chomp(char *str) { - int i, len; + size_t i, len; len = strlen(str); if (!len) @@ -358,7 +358,7 @@ void _x_meta_info_set_multi(xine_stream_t *stream, int info, ...) { va_list ap; char *args[1025]; char *buf; - int n, len; + size_t n, len; len = n = 0; diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c index 200721dca..8db7eaaf5 100644 --- a/src/xine-engine/input_rip.c +++ b/src/xine-engine/input_rip.c @@ -517,10 +517,9 @@ static void rip_plugin_dispose(input_plugin_t *this_gen) { * returns non-zero, if there was enough space */ static int dir_file_concat(char *target, size_t maxlen, const char *dir, const char *name) { - size_t len_dir, len_name, pos_name = 0; - - len_name = strlen(name); - len_dir = strlen(dir); + size_t len_name = strlen(name); + size_t len_dir = strlen(dir); + size_t pos_name = 0; /* remove slashes */ if (dir[len_dir - 1] == '/') len_dir--; diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 8c4ce8e4e..558aa996e 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -1933,9 +1933,9 @@ int xine_get_pos_length (xine_stream_t *stream, int *pos_stream, return 1; } -static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *height, - int *ratio_code, int *format, - uint8_t **img, int *size, int alloc_img) { +static int _x_get_current_frame_data (xine_stream_t *stream, + xine_current_frame_data_t *data, + int flags, int img_size_unknown) { vo_frame_t *frame; size_t required_size; @@ -1944,42 +1944,49 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he frame = stream->video_out->get_last_frame (stream->video_out); stream->xine->port_ticket->release(stream->xine->port_ticket, 0); - if (!frame) + if (!frame) { + data->img_size = 0; return 0; + } - *width = frame->width; - *height = frame->height; + data->width = frame->width; + data->height = frame->height; + data->crop_left = frame->crop_left; + data->crop_right = frame->crop_right; + data->crop_top = frame->crop_top; + data->crop_bottom = frame->crop_bottom; - *ratio_code = 10000.0 * frame->ratio; + data->ratio_code = 10000.0 * frame->ratio; /* make ratio_code backward compatible */ #define RATIO_LIKE(a, b) ((b) - 1 <= (a) && (a) <= 1 + (b)) - if (RATIO_LIKE(*ratio_code, 10000)) - *ratio_code = XINE_VO_ASPECT_SQUARE; - else if (RATIO_LIKE(*ratio_code, 13333)) - *ratio_code = XINE_VO_ASPECT_4_3; - else if (RATIO_LIKE(*ratio_code, 17778)) - *ratio_code = XINE_VO_ASPECT_ANAMORPHIC; - else if (RATIO_LIKE(*ratio_code, 21100)) - *ratio_code = XINE_VO_ASPECT_DVB; + if (RATIO_LIKE(data->ratio_code, 10000)) + data->ratio_code = XINE_VO_ASPECT_SQUARE; + else if (RATIO_LIKE(data->ratio_code, 13333)) + data->ratio_code = XINE_VO_ASPECT_4_3; + else if (RATIO_LIKE(data->ratio_code, 17778)) + data->ratio_code = XINE_VO_ASPECT_ANAMORPHIC; + else if (RATIO_LIKE(data->ratio_code, 21100)) + data->ratio_code = XINE_VO_ASPECT_DVB; - *format = frame->format; + data->format = frame->format; + data->interlaced = frame->progressive_frame ? 0 : (2 - frame->top_field_first); - switch (*format) { + switch (frame->format) { case XINE_IMGFMT_YV12: - required_size = *width * *height - + ((*width + 1) / 2) * ((*height + 1) / 2) - + ((*width + 1) / 2) * ((*height + 1) / 2); + required_size = frame->width * frame->height + + ((frame->width + 1) / 2) * ((frame->height + 1) / 2) + + ((frame->width + 1) / 2) * ((frame->height + 1) / 2); break; case XINE_IMGFMT_YUY2: - required_size = *width * *height - + ((*width + 1) / 2) * *height - + ((*width + 1) / 2) * *height; + required_size = frame->width * frame->height + + ((frame->width + 1) / 2) * frame->height + + ((frame->width + 1) / 2) * frame->height; break; default: - if (*img || alloc_img) { + if (data->img || (flags & XINE_FRAME_DATA_ALLOCATE_IMG)) { xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "xine: error, snapshot function not implemented for format 0x%x\n", frame->format); _x_abort (); @@ -1988,38 +1995,36 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he required_size = 0; } - if (alloc_img) { - /* return size if requested */ - if (size) - *size = required_size; + if (flags & XINE_FRAME_DATA_ALLOCATE_IMG) { + /* return allocated buffer size */ + data->img_size = required_size; /* allocate img or fail */ - if (!(*img = calloc(1, required_size))) + if (!(data->img = calloc(1, required_size))) return 0; } else { /* fail if supplied buffer is to small */ - if (*img && size && *size < required_size) { - *size = required_size; + if (data->img && !img_size_unknown && data->img_size < required_size) { + data->img_size = required_size; return 0; } - /* return size if requested */ - if (size) - *size = required_size; + /* return used buffer size */ + data->img_size = required_size; } - if (*img) { + if (data->img) { switch (frame->format) { case XINE_IMGFMT_YV12: yv12_to_yv12( /* Y */ frame->base[0], frame->pitches[0], - *img, frame->width, + data->img, frame->width, /* U */ frame->base[1], frame->pitches[1], - *img+frame->width*frame->height, frame->width/2, + data->img+frame->width*frame->height, frame->width/2, /* V */ frame->base[2], frame->pitches[2], - *img+frame->width*frame->height+frame->width*frame->height/4, frame->width/2, + data->img+frame->width*frame->height+frame->width*frame->height/4, frame->width/2, /* width x height */ frame->width, frame->height); break; @@ -2029,7 +2034,7 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he /* src */ frame->base[0], frame->pitches[0], /* dst */ - *img, frame->width*2, + data->img, frame->width*2, /* width x height */ frame->width, frame->height); break; @@ -2043,23 +2048,67 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he return 1; } +int xine_get_current_frame_data (xine_stream_t *stream, + xine_current_frame_data_t *data, + int flags) { + + return _x_get_current_frame_data(stream, data, flags, 0); +} + int xine_get_current_frame_alloc (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t **img, int *size) { - uint8_t *no_img = NULL; - return _x_get_current_frame_impl(stream, width, height, ratio_code, format, img ? img : &no_img, size, img != NULL); + uint8_t **img, int *img_size) { + + int result; + xine_current_frame_data_t data; + + memset(&data, 0, sizeof (data)); + + result = _x_get_current_frame_data(stream, &data, img ? XINE_FRAME_DATA_ALLOCATE_IMG : 0, 0); + if (width) *width = data.width; + if (height) *height = data.height; + if (ratio_code) *ratio_code = data.ratio_code; + if (format) *format = data.format; + if (img_size) *img_size = data.img_size; + if (img) *img = data.img; + return result; } int xine_get_current_frame_s (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, - uint8_t *img, int *size) { - return (!img || size) && _x_get_current_frame_impl(stream, width, height, ratio_code, format, &img, size, 0); + uint8_t *img, int *img_size) { + int result; + xine_current_frame_data_t data; + + memset(&data, 0, sizeof (data)); + data.img = img; + if (img_size) + data.img_size = *img_size; + + result = _x_get_current_frame_data(stream, &data, 0, 0); + if (width) *width = data.width; + if (height) *height = data.height; + if (ratio_code) *ratio_code = data.ratio_code; + if (format) *format = data.format; + if (img_size) *img_size = data.img_size; + return result; } int xine_get_current_frame (xine_stream_t *stream, int *width, int *height, int *ratio_code, int *format, uint8_t *img) { - return _x_get_current_frame_impl(stream, width, height, ratio_code, format, &img, NULL, 0); + int result; + xine_current_frame_data_t data; + + memset(&data, 0, sizeof (data)); + data.img = img; + + result = _x_get_current_frame_data(stream, &data, 0, 1); + if (width) *width = data.width; + if (height) *height = data.height; + if (ratio_code) *ratio_code = data.ratio_code; + if (format) *format = data.format; + return result; } int xine_get_video_frame (xine_stream_t *stream, diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index 597608883..415ceec56 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.c @@ -945,7 +945,7 @@ int _x_message(xine_stream_t *stream, int type, ...) { xine_ui_message_data_t *data; xine_event_t event; const char *explanation; - int size; + size_t size; int n; va_list ap; char *s, *params; diff --git a/src/xine-utils/list.c b/src/xine-utils/list.c index 65bdaec26..b157bda3f 100644 --- a/src/xine-utils/list.c +++ b/src/xine-utils/list.c @@ -69,7 +69,7 @@ struct xine_list_s { */ static xine_list_chunk_t *xine_list_alloc_chunk(size_t size) { xine_list_chunk_t *new_chunk; - size_t chunk_mem_size;; + size_t chunk_mem_size; chunk_mem_size = sizeof(xine_list_chunk_t); chunk_mem_size += sizeof(xine_list_elem_t) * size; diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 4085d65ee..9f5d122cb 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -525,7 +525,7 @@ void xine_hexdump (const char *buf, int length) { static const lang_locale_t *_get_first_lang_locale(const char *lcal) { const lang_locale_t *llocale; - int lang_len; + size_t lang_len; char *mod; if(lcal && *lcal) { diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index 426643708..2922135e2 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -597,11 +597,10 @@ static void xml_parser_dump_node (const xml_node_t *node, int indent) { xml_property_t *p; xml_node_t *n; - int l; printf ("%*s<%s ", indent, "", node->name); - l = strlen (node->name); + size_t l = strlen (node->name); p = node->props; while (p) { |