[MPlayer-dev-eng] SSA in mkv with adjacent \N patch

Robert Henney robh at rut.org
Wed Feb 16 21:43:09 CET 2005


patch to address minor mkv subtitle issues. (full mail from mplayer-users
included at end)  can be treated as two seperate patches if desired.

change to subreader.h is to allow the occational script which contains 
more than 10 screen lines within a single subtitle.  (I choose 14 since 
it allowed for the particular script I was working with at the time)

change to demux_mkv.c is to allow all occurances of \N to be treated a
a newline, without missing any.


Index: main/subreader.h
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.h,v
retrieving revision 1.37
diff -r1.37 subreader.h
32c32
< #define SUB_MAX_TEXT 10
---
> #define SUB_MAX_TEXT 14
Index: main/libmpdemux/demux_mkv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.c,v
retrieving revision 1.37
diff -r1.37 demux_mkv.c
2586c2586
<           if (*ptr1 == '\\' && ptr1+1-block < size && (*(ptr1+1)|0x20) == 'n')
---
>           while (*ptr1 == '\\' && ptr1+1-block < size && (*(ptr1+1)|0x20) == 'n')


Forwarded from mplayer-users:
|Date: Wed, 16 Feb 2005 15:05:17 -0500
|To: "MPlayer usage questions, feature requests,  bug reports" <mplayer-users at mplayerhq.hu>
|Subject: Re: [MPlayer-users] SSA in mkv with \N\N
|Message-ID: <20050216150517.A32255 at linear.mv.com>
|From: Robert Henney <robh at rut.org>
|Reply-To: "MPlayer usage questions, feature requests,  bug reports" <mplayer-users at mplayerhq.hu>
|
|On Mon, Feb 14, 2005 at 08:27:40PM -0500, Robert Henney wrote:
|> I'm not sure if doubling up line terminators in SSA is legal,
|> but I've noticed that mplayer appears to only count the 
|> first \N encountered as a line terminator when two are placed
|> together.  eg. "line1\N\Nline3" will display:
|
|Here's the fix.  Not a diff patch right now, sorry, but will probably 
|submit one soon.
|
|In libmpdemux/demux_mkv.c, on line 2586, change that "if" to "while".
|
|Also, I found it beneficial to increase the define for SUB_MAX_TEXT
|(subreader.h, line 32) from 10 to something larger, such as 14. Some 
|subtitle scripts attempt to place more than 10 lines on the
|screen at a time (such as during the credits), and when that happens 
|none of them would be displayed because exceeding SUB_MAX_TEXT will 
|force the whole portion to be considered invalid.
|
|-- 
|robh
|
|_______________________________________________
|MPlayer-users mailing list
|MPlayer-users at mplayerhq.hu
|http://mplayerhq.hu/mailman/listinfo/mplayer-users

-- 
robh




More information about the MPlayer-dev-eng mailing list