diff options
author | Dubois Nicolas <sn00py.2@laposte.net> | 2007-12-27 14:24:48 +0000 |
---|---|---|
committer | Dubois Nicolas <sn00py.2@laposte.net> | 2007-12-27 14:24:48 +0000 |
commit | 84e2f56c6cc81e9bed8ba03b29a8c69aa7d08d89 (patch) | |
tree | d6ffee7ab1c4e184afd2459ae60d06de03e0d081 /po | |
parent | 0fed3e1eccfdbae81961b3aadff0375c54c9f8d5 (diff) | |
download | xine-lib-84e2f56c6cc81e9bed8ba03b29a8c69aa7d08d89.tar.gz xine-lib-84e2f56c6cc81e9bed8ba03b29a8c69aa7d08d89.tar.bz2 |
[Subtitles] SSA-tags patch
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...
Diffstat (limited to 'po')
0 files changed, 0 insertions, 0 deletions