summaryrefslogtreecommitdiffstats
path: root/subreader.c
Commit message (Collapse)AuthorAgeFilesLines
* subreader.c: place conditionally declaration under #ifdefdiego2010-11-021-0/+2
| | | | | | | 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
* subreader.c: Extract duplicated code into a separate function.reimar2010-11-021-6/+11
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31346 b3059339-0415-0410-9bf9-f77b7e298cf2
* subreader.c: check for max line count in SAMI subtitle readerreimar2010-11-021-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31345 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: Fix typo in commenthyc2010-11-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31341 b3059339-0415-0410-9bf9-f77b7e298cf2
* options: move -alang and -slang to option structUoti Urpala2010-05-221-2/+6
| | | | | | | 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.
* subreader.c: allow compilation with old FriBiDi 0.10Uoti Urpala2010-05-161-0/+4
| | | | | | | | 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.
* subreader: remove pointless messageUoti Urpala2010-05-081-1/+2
| | | | | | 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.
* subreader.c: fix fribidi variable typeUoti Urpala2010-05-081-2/+1
| | | | | Use FriBidiParType instead of FriBidiCharType for a variable used as the third argument of fribidi_log2vis().
* Merge svn changes up to r30815Uoti Urpala2010-03-101-45/+50
|\
| * Extend stream_read_line to support reading lines from UTF-16 encoded filesreimar2010-02-281-45/+50
| | | | | | | | | | | | | | 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
* | Merge svn changes up to r30798Uoti Urpala2010-03-101-3/+3
|\|
| * sub_utf8 is handled as a value, not flags everywhere else, so changereimar2010-02-281-1/+1
| | | | | | | | | | | | | | sub_utf8 & 2 to == 2. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30798 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Make array describing the subtitle reader modules const.reimar2010-02-281-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30797 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30748Uoti Urpala2010-03-101-2/+2
|\|
| * Do not cast the results of malloc/calloc/realloc.diego2010-02-261-2/+2
| | | | | | | | | | | | | | | | 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
* | Merge svn changes up to r30663Uoti Urpala2010-03-101-1/+1
|\| | | | | | | | | | | | | Conflicts: gui/cfg.c libmpcodecs/vd_dmo.c mplayer.c
| * Replace platform preprocessor check by HAVE_DOS_PATHS.komh2010-02-191-1/+1
| | | | | | | | | | | | | | This is both more elegant and more portable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30650 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-2/+16
|\|
| * Add license header to all top-level files missing them.diego2010-01-301-2/+16
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30419Uoti Urpala2010-01-251-9/+12
|\|
| * Fix sub_free to actually free the subtitle data.reimar2010-01-221-6/+6
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30390 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Fix a memory leak in the subreader.reimar2010-01-221-1/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30389 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Replace strncat by av_strlcat which is easier to verify for correctness.reimar2010-01-221-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30388 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30264Uoti Urpala2010-01-251-4/+4
|\| | | | | | | | | Conflicts: gui/wm/ws.c
| * Use !isspace() to replace isalnum() to avoid filename mismatch under MBCSzuxy2010-01-101-4/+4
| | | | | | | | | | | | | | | | 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
* | subreader.c: fix excessive memory use with some external subtitlesUoti Urpala2010-01-161-0/+5
|/ | | | | | | | | | | | 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.
* Finally rename the STREAM_SEEK define to MP_STREAM_SEEK, there are just too manyreimar2009-11-221-1/+1
| | | | | | | 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
* Fix crash with partial fribidi conversion.reimar2009-11-221-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29952 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make fribidi (i.e. right-to-left) support work with embedded subtitles.reimar2009-11-221-3/+13
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29950 b3059339-0415-0410-9bf9-f77b7e298cf2
* sub_fribidi should be static, it is not used outside subreader.creimar2009-11-201-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29937 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use early return instead of block over whole function.reimar2009-11-201-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29936 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use FFMAX instead of a custom max macro.reimar2009-11-201-4/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29935 b3059339-0415-0410-9bf9-f77b7e298cf2
* whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-16/+16
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* Get rid of some more trailing whitespacereynaldo2009-05-121-76/+76
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29293 b3059339-0415-0410-9bf9-f77b7e298cf2
* Reduce subtitle parsing verbosity.diego2009-04-121-5/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29172 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace preprocessor check for WIN32 with checks for __MINGW32__ and __CYGWIN__.diego2008-10-131-1/+1
| | | | | | | 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
* Rename font-related preprocessor directives.diego2008-08-071-16/+16
| | | | | | | Switch them from a HAVE_ to a CONFIG_ prefix. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27425 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename some preprocessor directives from CONFIG_* to HAVE_* where appropriate;diego2008-08-011-12/+12
| | | | | | | 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
* Start unifying names of internal preprocessor directives.diego2008-07-301-23/+23
| | | | | | | | 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
* Clear iconv conversion state after each subtitle line.eugeni2008-05-291-0/+5
| | | | | | | | | | 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
* cosmetics: Remove useless parentheses from return statements.diego2008-05-161-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26791 b3059339-0415-0410-9bf9-f77b7e298cf2
* subreader.c: remove unused codeuau2008-04-121-25/+0
| | | | | | | 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
* Move sub_utf8_prev declaration out of the DUMPSUBS #ifdef.diego2008-03-181-1/+1
| | | | | | | This helps compilation if DUMPSUBS is defined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26263 b3059339-0415-0410-9bf9-f77b7e298cf2
* On Win32 and OS/2, 'x:filename' path style without '\' path separatordiego2008-02-241-1/+2
| | | | | | | | | 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
* Fix illegal identifiers: Names starting with __ or _ and uppercase are reserveddiego2008-01-061-1/+1
| | | | | | | 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
* Typo fix in messagereimar2007-12-221-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25498 b3059339-0415-0410-9bf9-f77b7e298cf2
* The function parameter 'preferred_language' should be const char *.ulion2007-12-171-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25428 b3059339-0415-0410-9bf9-f77b7e298cf2
* Cleanup guess_buffer_cp() a bit, remove tmp variable, break the loop on success.iive2007-10-281-7/+6
| | | | | | | Requested by ulion. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24880 b3059339-0415-0410-9bf9-f77b7e298cf2
* Our enca code uses strdup() on the input encoding name, as we don't modify ↵iive2007-10-281-12/+7
| | | | | | | | | | 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
* Revert r24103, it was nonsense and add a comment that explains the codereimar2007-09-221-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24591 b3059339-0415-0410-9bf9-f77b7e298cf2
* -subfps makes sense for frame-based subtitle formats as well!reimar2007-08-201-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24103 b3059339-0415-0410-9bf9-f77b7e298cf2
* Revert r23443, it breaks compilation without libass.eugeni2007-06-021-16/+30
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23449 b3059339-0415-0410-9bf9-f77b7e298cf2
* Recode the whole subtitle file to utf-8 before parsing.eugeni2007-06-011-30/+16
| | | | | | | This allows reading subtitles in ucs-2. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23443 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l: comparison of char* ptrs with string literalsfaust32007-02-191-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22274 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix code updating subtitle array which only moved the text, not endpts.uau2007-02-051-1/+3
| | | | | | | Led to multiple subtitles on screen disappearing too early without -ass. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22159 b3059339-0415-0410-9bf9-f77b7e298cf2
* In .srt, any line containing only spaces and tabs marks the end of theeugeni2007-01-181-2/+5
| | | | | | | current subtitle. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21957 b3059339-0415-0410-9bf9-f77b7e298cf2
* Document sub_add_text and sub_clear_textreimar2007-01-071-0/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21851 b3059339-0415-0410-9bf9-f77b7e298cf2
* Subtitle handling cleanup: factor out code for parsing embedded subtitlesreimar2007-01-061-0/+71
| | | | | | | and adding and removing of lines in subtitle struct into subreader.c. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21845 b3059339-0415-0410-9bf9-f77b7e298cf2
* redone subcp_recode: get rid of static buffer, skip lines that failed toreimar2006-10-181-45/+11
| | | | | | | | convert instead of removing all remaining lines and remove subcp_recode1 since subcp_recode should now work just as well. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20298 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix missleading msg printed when subcp_open is given NULL as parameter (like ↵gpoirier2006-09-181-1/+2
| | | | | | | | | | | | | | as demux_ogg and demux_mkv do) Patch by: Zuxy Meng %zuxy.meng A gmail P com% Original Thread: Message-ID: <a18e06b40609160400l74263121p5f41eaf3549caf5@mail.gmail.com> Date: Sat, 16 Sep 2006 19:00:57 +0800 To: mplayer-dev-eng@mplayerhq.hu Subject: [MPlayer-dev-eng] [PATCH] Remove erroneaus warning message in subreader.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19883 b3059339-0415-0410-9bf9-f77b7e298cf2
* introduce new 'stream' directory for all stream layer related components and ↵ben2006-07-311-1/+1
| | | | | | split them from libmpdemux git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19277 b3059339-0415-0410-9bf9-f77b7e298cf2
* corrects some casts that previously discarded the const qualifier. Patch by ↵reynaldo2006-07-271-3/+3
| | | | | | Stefan Huehner, stefan AT Huehner-org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19203 b3059339-0415-0410-9bf9-f77b7e298cf2
* marks several function without a prototype which arent used outside its ↵reynaldo2006-07-131-18/+18
| | | | | | sourcefile as static, Patch by Stefan Huehner - stefan AT huehner-org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19071 b3059339-0415-0410-9bf9-f77b7e298cf2
* Marks several string parameters as const when they are not modified in the ↵reynaldo2006-07-091-1/+1
| | | | | | function, Patch by Stefan Huehner, stefan AT huehner-org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18985 b3059339-0415-0410-9bf9-f77b7e298cf2
* Split guess_cp() in two functions:eugeni2006-07-071-10/+22
| | | | | | | | | - guess_buffer_cp() determines the encoding of text, given a pointer to a buffer and its length; - guess_cp() reads some data from stream and calls guess_buffer_cp() git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18941 b3059339-0415-0410-9bf9-f77b7e298cf2
* this unrelated and erroneus change was applied on my previous commit, revertedreynaldo2006-07-011-1/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18875 b3059339-0415-0410-9bf9-f77b7e298cf2
* rm unnecesary void* casts - part 1reynaldo2006-07-011-28/+25
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18874 b3059339-0415-0410-9bf9-f77b7e298cf2
* more sizeof(char) funreynaldo2006-06-301-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18861 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix problem when subtitle file name is shorter than ".utf-8"gpoirier2006-06-141-1/+1
| | | | | | | | | | Patch by Evgeniy Stepanov < eugeni P stepanov A gmail P com > Original thread: Date: May 23, 2006 10:57 PM Subject: [MPlayer-dev-eng] [BUG][PATCH] uninitialized memory access in subreader.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18707 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix uninitialized pointer value being passed to open_stream, where it is ↵gpoirier2006-06-141-0/+1
| | | | | | | | | | | | used in comparison. Patch by Eugeniy Stepanov < eugeni P stepanov A gmail P com > Original Thread: Date: May 23, 2006 10:57 PM Subject: [MPlayer-dev-eng] [BUG][PATCH] uninitialized memory access i