Commit Graph

222 Commits

Author SHA1 Message Date
diego d09cc29578 subreader.c: place conditionally declaration under #ifdef
Surround conditionally used orig_lines variable declaration by #ifdefs.
This avoids an unused variable warning when fribidi is not available.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31519 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:11:07 +02:00
reimar c280fd08c3 subreader.c: Extract duplicated code into a separate function.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31346 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:07:12 +02:00
reimar 074e6b4622 subreader.c: check for max line count in SAMI subtitle reader
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31345 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:07:12 +02:00
hyc d6da056180 cosmetics: Fix typo in comment
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31341 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:06:21 +02:00
Uoti Urpala b3a688d45f options: move -alang and -slang to option struct
The option field corresponding to -slang is now called "sub_lang"
instead of the old misleading global name "dvdsub_lang". The code
handling -slang in subreader.c looks rather broken; disable it instead
of converting it to use the option field.
2010-05-22 10:11:15 +03:00
Uoti Urpala c67d3dfcfc subreader.c: allow compilation with old FriBiDi 0.10
After fixing the type of the third parameter given to fribidi_log2vis
the code didn't compile with old FriBiDi 0.10 any more. Seems that the
parameter type has changed in FriBiDi and the type expected by current
versions didn't exist in older ones at all. Fix compilation with old
FriBiDi by adding an #if based on FRIBIDI_INTERFACE_VERSION.
2010-05-16 06:11:16 +03:00
Uoti Urpala b26d8828d4 subreader: remove pointless message
The code printed a pointless "dvdsublang..." message at MSGL_INFO
level. Remove that. Add instead a MSGL_DBG2 message showing tested
files and their priorities.
2010-05-08 22:43:36 +03:00
Uoti Urpala 33efcaf157 subreader.c: fix fribidi variable type
Use FriBidiParType instead of FriBidiCharType for a variable used as
the third argument of fribidi_log2vis().
2010-05-08 22:15:32 +03:00
Uoti Urpala 4857965118 Merge svn changes up to r30815 2010-03-10 02:36:35 +02:00
Uoti Urpala bc1d0ca37d Merge svn changes up to r30798 2010-03-10 02:35:02 +02:00
Uoti Urpala e74708f619 Merge svn changes up to r30748 2010-03-10 01:50:55 +02:00
Uoti Urpala 13221a7165 Merge svn changes up to r30663
Conflicts:
	gui/cfg.c
	libmpcodecs/vd_dmo.c
	mplayer.c
2010-03-10 00:13:11 +02:00
Uoti Urpala 12d3caebc7 Merge svn changes up to r30475 2010-03-09 19:18:43 +02:00
reimar b20e08ed94 Extend stream_read_line to support reading lines from UTF-16 encoded files
and use this to support reading UTF-16 encoded subtitle files in subreader.c


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30799 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-28 15:24:30 +00:00
reimar e9a5e7f667 sub_utf8 is handled as a value, not flags everywhere else, so change
sub_utf8 & 2 to == 2.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30798 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-28 14:27:44 +00:00
reimar 9538251171 Make array describing the subtitle reader modules const.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30797 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-28 14:22:44 +00:00
diego b63759b175 Do not cast the results of malloc/calloc/realloc.
These functions return void*, which is compatible with any pointer,
so there is no need for casts.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30744 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-26 15:01:37 +00:00
komh 316e05b877 Replace platform preprocessor check by HAVE_DOS_PATHS.
This is both more elegant and more portable.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30650 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-19 09:14:01 +00:00
diego 99c1bbca2a Add license header to all top-level files missing them.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-30 23:24:23 +00:00
Uoti Urpala e28e4a1b15 Merge svn changes up to r30419 2010-01-25 15:59:53 +02:00
Uoti Urpala 0f72485ee7 Merge svn changes up to r30264
Conflicts:
	gui/wm/ws.c
2010-01-25 14:52:29 +02:00
reimar 3526daed7a Fix sub_free to actually free the subtitle data.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30390 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-22 22:10:28 +00:00
reimar 7b953c1763 Fix a memory leak in the subreader.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30389 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-22 21:49:05 +00:00
reimar 1e4f16a344 Replace strncat by av_strlcat which is easier to verify for correctness.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30388 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-22 21:16:54 +00:00
Uoti Urpala 6ead3e936b subreader.c: fix excessive memory use with some external subtitles
For each sequence of consecutive partially overlapping subtitles, the
algorithm calculating screen positions for the subtitles allocated a
2*subtitle_count*subtitle_line_count array. With some karaoke
subtitles that had lots of rapidly changing overlapping subtitles this
became large enough to use gigabytes of memory. Make the behavior
saner by limiting the line count to SUB_MAX_TEXT lines (the maximum
number of lines to show on screen at once, currently 12). This
shouldn't change the end result of the algorithm other than possibly
printing different warnings.
2010-01-16 12:44:00 +02:00
zuxy 534f6aa6b5 Use !isspace() to replace isalnum() to avoid filename mismatch under MBCS
locale like those in East Asia where most glyphs are neither alphabetical nor
numerical.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30258 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-10 13:52:44 +00:00
reimar af2988cbce Finally rename the STREAM_SEEK define to MP_STREAM_SEEK, there are just too many
name clashes, in particular with Windows headers (which define STREAM_SEEK as an enum type).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29962 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-22 15:18:21 +00:00
reimar 4d55629cd6 Fix crash with partial fribidi conversion.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29952 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-22 00:22:24 +00:00
reimar 03e99c5cb8 Make fribidi (i.e. right-to-left) support work with embedded subtitles.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29950 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-22 00:09:40 +00:00
reimar dc6a72386c sub_fribidi should be static, it is not used outside subreader.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29937 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-20 10:32:45 +00:00
reimar 752839d86b Use early return instead of block over whole function.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29936 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-20 10:24:31 +00:00
reimar 6712791ad6 Use FFMAX instead of a custom max macro.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29935 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-20 10:22:57 +00:00
diego 6e9cbdc104 whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-13 02:58:57 +00:00
reynaldo 6d781a3226 Get rid of some more trailing whitespace
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29293 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-12 02:41:04 +00:00
diego a19db0165d Reduce subtitle parsing verbosity.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29172 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-04-12 20:44:20 +00:00
diego 4d644f513c Replace preprocessor check for WIN32 with checks for __MINGW32__ and __CYGWIN__.
This avoids a pointless indirection that only obscures what is really done.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27761 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-10-13 16:23:55 +00:00
diego 091d352d06 Rename font-related preprocessor directives.
Switch them from a HAVE_ to a CONFIG_ prefix.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27425 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-07 10:36:07 +00:00
diego d17f9943af Rename some preprocessor directives from CONFIG_* to HAVE_* where appropriate;
CONFIG_ prefix for configurable options, HAVE_ for system-dependent stuff.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27391 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-01 20:28:58 +00:00
diego 4b141479da Start unifying names of internal preprocessor directives.
Replace all USE_ prefixes by CONFIG_ prefixes to indicate
options which are configurable.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-07-30 12:01:30 +00:00
eugeni f5a8ce6408 Clear iconv conversion state after each subtitle line.
This fixes a bug when the last character on a subtitle line
is sometimes moved to the beginning of the next line.

Patch by Guy Shapiro, bugs sguy org.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26921 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-05-29 18:35:17 +00:00
diego 5423c418c2 cosmetics: Remove useless parentheses from return statements.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26791 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-05-16 09:42:28 +00:00
uau 43ff8aa004 subreader.c: remove unused code
Remove code under "#ifdef DUMPSUBS". This code hasn't worked in years.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26409 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-04-12 15:51:02 +00:00
diego 8a7e7eb34c Move sub_utf8_prev declaration out of the DUMPSUBS #ifdef.
This helps compilation if DUMPSUBS is defined.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26263 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-03-18 12:49:54 +00:00
diego 1cd1c92fb7 On Win32 and OS/2, 'x:filename' path style without '\' path separator
is possible as well as 'x:\dir\filename' style. So we should check ':'
unless '\' is found.
patch by KO Myung-Hun, komh chollian net


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26087 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-24 12:40:30 +00:00
diego e27d606714 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
for the system, names starting with _ are reserved at file level.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25635 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-06 23:20:15 +00:00
reimar 2b9c02cca0 Typo fix in message
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25498 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-22 16:05:37 +00:00
ulion 9bfbfd8c4d The function parameter 'preferred_language' should be const char *.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25428 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-17 01:06:17 +00:00
iive b69670151c Cleanup guess_buffer_cp() a bit, remove tmp variable, break the loop on success.
Requested by ulion.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24880 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-28 15:53:08 +00:00
iive b43c16f8b6 Our enca code uses strdup() on the input encoding name, as we don't modify it we can use the original constant string.
Uses less memory, code is simpler and faster.
Fixes memory leak (noticed by ulion).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24879 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-28 14:26:05 +00:00
reimar f2b9c324ff Revert r24103, it was nonsense and add a comment that explains the code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24591 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-22 13:24:58 +00:00