summaryrefslogtreecommitdiff
path: root/src/libsputext/demux_sputext.c
AgeCommit message (Collapse)Author
2009-11-30Trim trailing space & reduce space+tab.Darren Salt
2009-01-01check length parameter against buffer length in libsputext read_line_from_inputMatthias Hopf
Currently, this is satisfied in all locations where it is called, but it is more prudent to add the check.
2008-07-04Simplify code and update code style.Diego 'Flameeyes' Pettenò
--HG-- extra : transplant_source : i%86L%8F_h%1D%DDv%DF%E4%2B%906%8B%FBM%87h%2A
2008-05-09Use size_t to keep the value returned by strlen().Diego 'Flameeyes' Pettenò
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
2008-05-09Avoid transforming a string to uppecase, and avoid one call to strlen().Diego 'Flameeyes' Pettenò
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.
2008-05-07Use strn?dup instead of alloc + strn?cpy.Diego 'Flameeyes' Pettenò
Whenever an allocated memory area is immediately filled in with a string through strcpy() or strncpy(), replace the calls with the appropriate strn?dup().
2008-05-07xine_xmalloc() deprecation: replace its use with static and non-zero size.Diego 'Flameeyes' Pettenò
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
2008-04-14Title array has only five entries. It can be overrun.Erik Hovland
2008-04-14strchr can return null. It should be checked.Erik Hovland
2008-04-14The code checks dest when it should check *dest.Erik Hovland
2007-12-27[Subtitles] SSA-tags patchDubois Nicolas
I watch a lot of movies with subtitles and I need "vobsub subtitles" work in xine, then I decide to write this patch. It may support SSA tags for all text subtiles (ssa, ass, srt, ...) This patch : 1. Remove all SSA tags from stream (they are ugly : {\a6}) 2. Handle some of them (b, i, a, an, pos). The other ones control colours, shadow, animation, ... I can't make them work in an easy way. 3. Correct wrap algorithm which have minors bugs (we can see them only with SSA patch...) Modified files : libsputext/demux_sputext.c just remove unneeded code (which remove some of SSA-tags) libsputext/xine_sputext_decoder.c the main modified file. video_out/video_out_xshm.c video_out/video_out_xv.c xine-engine/video_out.h get video output (position and size). See below. 1. Removing SSA tags is done in ogm_render_line_internal() like for html-like tags. (this was done in the previous version of xine) 2. b(bold) and i(italic) are implemented like html-ones, in ogm_render_line_internal(). The other tags this patch support are : aX : alignment in SSA-code anX : alignment in numpad code pos(X,Y) : position, depend on alignment For those ones, I need in first a full-screen OSD, not a five lines one. Then, I need to remember where the last subtitle was drawn, in order to erase it. At last, I need a translation function to convert subtitle coordinates in screen coordinates. For this last point, I first write a full-screen translation (don't care about blacks borders), but it's not really good: the 'pos' tag is sometime used to point out something in the video. (Moreover, ASS spec say we have to draw subtitle on the video) For doing this, I need the real video output size and position, which are only know by the video output driver! Then I had 4 VO properties (in xine-engine/video_out.h) for video driver could give us those informations. I implement it only in xshm and xv drivers (I can't test other ones). If video driver can't give us those informations, the patch fallback in a full-screen translation. 3. there was 3 problem with the wrap algorithm : 1. It was in double: exactly the same, twice. Look like a merge problem. I remove one and all work fine. 2. It want to cut string in equivalent display length but it cut it in equivalent byte length. In most cases, this is the same, but if we have UTF-8 chars or long SSA-tags (which will not be displayed) the result is strange. 3. If we have a too-long part (in bytes) of the string without spaces (bad subtitle file or long SSA-code), the algorithm don't know what to do. (this case is not handled) I re-write the wrap algorithm to correct those problems. Note that my version is slower than previous one : working with bytes is really faster than computing text-length. Maybe I should had to propose an other patch for this part...
2007-11-10Delete most of the CVS $Id$/$Log$ lines.Darren Salt
--HG-- extra : transplant_source : %E0%D0%C5%8B%BEU%DD%24%5D7%1F%ADV%AD%EB%23%CBU%80%EB
2007-11-09Update FSF address on non-contributed code and COPYING files.Diego 'Flameeyes' Pettenò
For contributed code, leave whatever the version we last synced for is using to make simpler future syncs.
2007-01-19Make get_mrl return a const char * too.Diego 'Flameeyes' Pettenò
CVS patchset: 8524 CVS date: 2007/01/19 01:05:24
2007-01-19Make get_description get_identifier get_extensions get_mimetypes return a ↵Diego 'Flameeyes' Pettenò
constant string, and make the extensions and mrl vaiables usually declared when testing extension demux strategy constants too. CVS patchset: 8523 CVS date: 2007/01/19 00:26:39
2007-01-18Fix comparing char* pointer with a string literal.Matthias Hopf
CVS patchset: 8515 CVS date: 2007/01/18 11:57:16
2006-12-08Fix wrong length specification for strncat() calls.Matthias Hopf
Consolidated multiple strncat() calls to snprintf(). CVS patchset: 8407 CVS date: 2006/12/08 16:26:10
2006-07-10Implement visibility support, available on GCC 4.0 and later and on some 3.4 ↵Diego 'Flameeyes' Pettenò
(through backports), to avoid exporting unneeded internal symbols, making plugins' loading faster and use of internal copies of libraries more solid. It should automatically fall back to the old way in GCCs that does not support -fvisibility=hidden, but has to be tested carefully. No issues were found in the months of testing in Gentoo, but this requires special attention anyway. CVS patchset: 8101 CVS date: 2006/07/10 22:08:12
2006-05-03Make various arrays and structures (mainly xine_plugin_info) const.Darren Salt
(Diego Pettenò) CVS patchset: 7985 CVS date: 2006/05/03 19:46:06
2006-02-14Kill a printf() warning.Darren Salt
CVS patchset: 7892 CVS date: 2006/02/14 18:41:43
2005-10-29fix some nonsense i did :)Miguel Freitas
CVS patchset: 7776 CVS date: 2005/10/29 20:51:01
2005-10-29some sort of subrip variantMiguel Freitas
CVS patchset: 7775 CVS date: 2005/10/29 20:18:57
2005-02-06Added node_plugin_t pointer to the demux struct.Thibaut Mattern
Incremented demux API version. This is needed to unload plugins. CVS patchset: 7385 CVS date: 2005/02/06 15:26:00
2004-12-17fix crash in sputext demuxer when subtitles have too many linesMichael Roitzsch
(closes bug #1086775) CVS patchset: 7267 CVS date: 2004/12/17 13:38:23
2004-12-12huge patch ahead: reorganizing config entries with automatic conversionMichael Roitzsch
and backwards compatible translation Sorry, I got a litte tired proof-reading the patch, so their might be bugs lurking around. I will give it some further examination and (as necessary) fixing tomorrow. CVS patchset: 7233 CVS date: 2004/12/12 22:00:47
2004-11-03fix compiler warningMichael Roitzsch
CVS patchset: 7102 CVS date: 2004/11/03 19:17:54
2004-10-30misplaced }Miguel Freitas
CVS patchset: 7091 CVS date: 2004/10/30 14:29:23
2004-10-27Sylvain Colinet patchMiguel Freitas
CVS patchset: 7081 CVS date: 2004/10/27 22:22:25
2004-07-27from the docs of sprintf: "when the strings overlap, the behaviour is undefined"Michael Roitzsch
(actually it works with glibc and sprintf, but not with snprintf) CVS patchset: 6859 CVS date: 2004/07/27 18:06:45
2004-07-22* do not use strcpy with overlapping strings, the behaviour is undefinedMichael Roitzsch
* fixed lots of unprotected buffers, overlong subtitle lines would have caused overflows CVS patchset: 6833 CVS date: 2004/07/22 14:19:12
2004-06-13implement steps 1, 2, 3 and 4 of the seeking proposal:Miguel Freitas
http://article.gmane.org/gmane.comp.video.xine.devel/9532 it is now up to demuxers to decide what the 0..65535 position means. demuxers tested: ogg, voc, flac, rm, asf, vqa, vob, avi, y4m, au, mov, ts, mp3, mpg, wav, ra, mve CVS patchset: 6686 CVS date: 2004/06/13 21:28:52
2004-06-11Patch with improvements for libsputext from Vincent Pelletier - word wrap ↵František Dvořák
and enhanced subtitle parser. CVS patchset: 6673 CVS date: 2004/06/11 09:47:29
2004-04-26help strings added for all remaining config entries (so I hope)Michael Roitzsch
please everybody watch out for spelling (and other) errors CVS patchset: 6442 CVS date: 2004/04/26 17:50:06
2004-01-12it seems i forgot to commit the api increase (demux/decoder). weird.Miguel Freitas
CVS patchset: 6030 CVS date: 2004/01/12 17:35:14
2003-12-24* patch by David Gómez to support linebreaking '|' in subview formatMichael Roitzsch
* fix compiler warnings CVS patchset: 5947 CVS date: 2003/12/24 17:34:49
2003-12-17 * Default subtitle timeout.František Dvořák
Some formats define the end of a subtitle as the beginning of the following. But using configurable timeout seems better. * Three new formats of subtitles: - jacobsub from mplayer (not tested by me) - subviewer v2.0 from mplayer (not tested by me) - subrip v0.9 * Change deprecated bzero() to memset() CVS patchset: 5918 CVS date: 2003/12/17 13:41:05
2003-11-26lprintf cleanup, pass I.Daniel Caujolle-Bert
CVS patchset: 5796 CVS date: 2003/11/26 19:43:26
2003-11-16New stream/meta info (safe) stuff.Daniel Caujolle-Bert
BIG NOTE: use helpers to access to these informations (get/set/reset): _x_{stream,meta}_info_{get,set,reset}() are for internal use, don't use *_public() ones from inside the beast ;-) Some wrongly names "xine_" fonction renaming. CVS patchset: 5757 CVS date: 2003/11/16 23:33:42
2003-11-15start xine_stream_t separation (public/private).Miguel Freitas
(we should finish this before rc3.) - stream_info and meta_info variables are private now. obs: everything must be recompiled due xine_stream_t changes CVS patchset: 5733 CVS date: 2003/11/15 14:54:30
2003-11-15more helper functions cleanup (stream info, meta info)Miguel Freitas
CVS patchset: 5731 CVS date: 2003/11/15 13:01:00
2003-11-11rename internal API function (_x_<function>).Daniel Caujolle-Bert
CVS patchset: 5721 CVS date: 2003/11/11 18:44:50
2003-11-04remove errno usage (all input plugins should handle and report errors). Take ↵Daniel Caujolle-Bert
care of seek() return value. CVS patchset: 5684 CVS date: 2003/11/04 00:24:52
2003-11-03take care of read() return value. use xprintf/lprintf. fix get_extensions()Daniel Caujolle-Bert
CVS patchset: 5683 CVS date: 2003/11/03 23:58:18
2003-10-13Fix ssa handling. Fix ssa parsing by syncing to MPlayer.Daniel Caujolle-Bert
CVS patchset: 5501 CVS date: 2003/10/13 06:57:28
2003-08-24fix sami sub title detectionDaniel Caujolle-Bert
CVS patchset: 5303 CVS date: 2003/08/24 10:17:43
2003-08-04fixes suggested by Octavian Procopiuc <op1@duke.edu>Miguel Freitas
CVS patchset: 5242 CVS date: 2003/08/04 03:16:48
2003-08-04seek to start before detecting contentMiguel Freitas
not sure this is need, but it must be harmless :) patch by Marc Bevand CVS patchset: 5235 CVS date: 2003/08/04 01:37:58
2003-07-25small housekeeping: demuxer api seeks in milisecondsMiguel Freitas
CVS patchset: 5211 CVS date: 2003/07/25 21:02:04
2003-06-22remove unused class members and fix compiler warning (-1 is used as a marker, soMichael Roitzsch
the "unsigned" is wrong) CVS patchset: 5088 CVS date: 2003/06/22 16:53:04
2003-04-26bumping up demux plugin interface version numbers, update copyright noticesGuenter Bartsch
CVS patchset: 4691 CVS date: 2003/04/26 20:15:52