Age | Commit message (Collapse) | Author |
|
|
|
|
|
The new structure xine_current_frame_data_t additionally contains cropping
and interlacing information, which both are required for proper conversion
of the image. The existing functions have been adopted to use the code of
the new function. The changeset should be ABI compatible.
|
|
|
|
When using a variable to store the result of strlen(), make sure its
type is size_t just like the function returns, rather than using a
smaller type like int.
--HG--
extra : transplant_source : %B0%D5%3B%D7%1Dy%0A%7E%7D%7C%023%08%B2%CE%D3t%0B3%D7
|
|
Rewrite xine_get_file_extensions() and xine_get_mime_types() so that
they share the joining code, and do one less loop over the list of
plugins.
Create a new _x_concatenate_with_string() function to convert an array
of strings into a single string, which is called by both functions.
--HG--
extra : transplant_source : %BC7%3D%C7%A5%AA%A6%BB%11%9A%94%F0%E9%F1V%B7%29%C68h
|
|
--HG--
extra : transplant_source : %CE%27_Nt%C7%7E%C3%0Db3%CF%D5O%BA%1C%21%D3%93%1E
|
|
Instead of using strlen() to get the new size of the string every
time, use the value returned by snprintf() to gather the size of the
final string.
--HG--
extra : transplant_source : %AA%0D%D3d9%D6%99%D7BP%21w%F3%DE%8Au%90l%AD%16
|
|
--HG--
extra : transplant_source : %3B%87%DA%89%F2.%1F%F4%F0L/%C4%A3%5B%5C3%1A%09%05g
|
|
Instead of passing through a temporary ui_title array on the stack,
use the array already allocated for the xine_ui_data_t element. Also
do that for ui_str_length.
--HG--
extra : transplant_source : %1A%B5e%8E%C0gQ%A9%BC%08%B2%0Bm%A9Ec%C1%9F%23%EF
|
|
Instead of using a 1KB buffer to copy over the Content-Type header
value to compare it, get a (pointer, length) pair and use that for
comparison.
This should also allow the compiler to inline the
decode_anxdata_header() function.
--HG--
extra : transplant_source : W%EE%5CN%BD%B8%8C%FA%CD%15p%CD%A5%CBQ%1E%893%97S
|
|
In update_chapter_display() the t_title array, declared on the buffer,
is used after it has disappeared from the scope. Instead of doing
that, use directly the xine_ui_data_t array.
Declare xine_event_t and xine_ui_data_t with their values directly,
makes it more explicit that everything disappears at the end of the
function.
--HG--
extra : transplant_source : %25T%10eEd%CF%ECS%AC%A3%E3%E0%D3J%F6%A5%15%9EE
|
|
|
|
|
|
|
|
|
|
Instead of duplicating a buffer after using sn?printf() on it, use
asprintf() directly on the final variable.
|
|
|
|
|
|
Also, reduce visibility of the i variable to the loop where it is
used.
|
|
Also, don't reset buffers when we're just going to run a snprintf()
call, and avoid multiple calls to strlen() when we're appending to it.
|
|
Use the proper function for common memory operations (memset() for
zeroing, memcpy() for copying, memmove() for moving), instead of
looping through arrays.
By extension, remove loops to reset arrays when they were allocated
with calloc() and thus already zeroed.
|
|
Instead of looping through the directive string as returned by
sscanf() and transforming each character to its uppercase version, use
strcasestr to run a case-insensitive sub-string search.
Also avoid runing multiple strlen() calls per each line, use strncpy
instead.
|
|
Instead of executing strlen() after each snprintf() call, use the
value returned by the call itself.
Instead of using sprintf() on a buffer and then duplicate it, use
asprintf().
|
|
Also don't reset memory after it's allocated if we do that with
calloc.
|
|
- Add a configure test for the attribute, during xine build process.
- Define the attribute as supported when using GCC 2.95 or later
outside xine build process.
- Use the new XINE_PACKED define instead of the attribute directly.
- Check for SUPPORT_ATTRIBUTE_PACKED rather than doing strange
subdefines.
|
|
If needed, use calloc() to allocate the area so that it's already
reset by the time it returns.
|
|
Instead of using sscanf() to get the data out of headers, as we just
compared them, skip the name of the header and get the rest. Add the
whitespace to the compare so that it actually works as intended. Also
save some unneeded dup/free.
|
|
|
|
|
|
asprintf where appropriate.
Instead of creating a 100-elements filelist array, with each element
containing a 256 bytes string, make it dynamic, create it when
get_autoplay_list is called, free it if it was present before, and use
asprintf() for creating the entries.
This not only reduces the complexity of the code, but also reduces the
size of the input class object (which in turn reduce memory usage),
but also avoids memory leaks that the previous code certainly had. The
total memory used even with a full list of files should also be
drastically reduced.
Also, use asprintf while filling the mrls data, rather than allocating
a 1 KiB array on the stack, and use it as temporary.
|
|
Allocate all the frames, the extra info data and the audio and video
content areas as one big memory area each.
This also remove some use of xine_xmalloc().
|
|
|
|
Instead of duplicating twice the http_proxy environment variable
value, do so only once, avoid a strlen() call when checking if the
string is not empty, remove the http_proxy variable entirely, don't
free the duplicated string as that's what it's used.
|
|
|
|
Instead of creating strings through a series os string copy and
concatenations, use directly the appropriate printf-like function.
|
|
Whenever an allocated memory area is immediately filled in with a
string through strcpy() or strncpy(), replace the calls with the
appropriate strn?dup().
|
|
Instead of calling sprintf or snprintf with a "%s" format string, use
the proper strcpy, strncpy, strdup or strndup function.
|
|
There is no need to check if a pointer is not NULL before freeing it,
so just call free() during MRL_FREE.
During duplication, always prefer freeing and recreating to
reallocating, as that would probably take more time than would
actually be needed to allocate a new memory area. Also, most likely
the duplication will happen on a new instance.
|
|
Using asprintf() instead of malloc() + sprintf() reduces the lines of
code in xine-lib (moving the allocation to the C library or asprintf
replacement), makes it safer to access the string and can also improve
performance whenever the value returned by a function was used as
parameter, as before it had to run the function twice in almost every
case (once for strlen(), once for sprintf()).
|
|
|
|
The xine_xmalloc() function is going to be deprecated, as its
behaviour is rarely needed as such, and it's thus misused.
With this, almost all uses of xine_xmalloc() with static size (for
instance the value returned by sizeof()) or with a size that is
guaranteed not to be zero (like strlen()+1) are replaced with calls to
either calloc(1, ...) or malloc().
malloc() is used whenever the allocated memory is going to be
immediately overwritten, while calloc() is used in every other case,
as it sets the whole memory area to zero.
--HG--
extra : transplant_source : %8F%98%EC%02%1E%83%F0s%06X%83C%205Y%80%B12%CC%E1
|
|
|
|
When we're including xine/attributes.h but we're not building xine,
define the support for particular attributes based on the compiler and
its version. This way semantic information is maintained outside
xine's build (such as deprecated functions).
|
|
Functions and data structures that are not exported and are only ever
used in the same unit they are defined should be marked static to
improve compiler's ability to optimise them.
This applies to xine_dispose_internal() function for xine-lib, the
extended_to_int() function in the AIFF demuxer, the bandwidths array
in QuickTime demuxer, the wc_pal_lookup table in the WC3 movie
demuxer, and the rm_header and pnm_data_header arrays in pnm input
plugin.
|
|
The xine_check.h header is not currently installed and the symbols are
not exported, their are only ever used in the same unit they are
defined.
|
|
|
|
|
|
rather than just checking for GCC 3.
|
|
all attributes.
|