[MPlayer-users] Re: .OGG (.ogm) subtitles suport
Piotr Krukowiecki
piotr at pingu.ii.uj.edu.pl
Wed Aug 21 16:04:01 CEST 2002
On Wed, 21 Aug 2002, Rémi Guyomarch wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> On Wed, Aug 21, 2002 at 12:54:54AM +0200, Piotr Krukowiecki wrote:
> ...
> > - in one of those movies *very* often two near words are displayed
> > together (for example 'cometo' instead of 'come to'). Maybe because
> > of not perfect tags removal
>
> FYI, it's quite common for OCR'ed DVD subs. I've seen many text
> subtitles with this problem. May be it's the case here, maybe not.
In this case it was mplayer fault. In this movie new lines are '\n' while
usually they are '\r\n' - and mplayer just skipped \n\ not inserting new line.
Ateched patch fixes this, as well as increases SUB_MAX_TEXT and disables
tags removal (well, i prefer to see "<i>start</i>" then "istart/i")
--
Piotrek
irc: #debian.pl
Mors Drosophilis melanogastribus!
-------------- next part --------------
diff -Nurp MPlayer-20020820-org/libmpdemux/demux_ogg.c MPlayer-20020820/libmpdemux/demux_ogg.c
--- MPlayer-20020820-org/libmpdemux/demux_ogg.c Wed Aug 21 13:02:56 2002
+++ MPlayer-20020820/libmpdemux/demux_ogg.c Wed Aug 21 15:24:24 2002
@@ -164,7 +164,7 @@ void demux_ogg_add_sub (char* packet) {
lcv = 3;
while (1) {
int c = packet[lcv++];
- if(c=='\r' || c==0 || line_pos >= OGG_SUB_MAX_LINE-1){
+ if(c=='\n' || c==0 || line_pos >= OGG_SUB_MAX_LINE-1){
ogg_sub.text[ogg_sub.lines][line_pos] = 0; // close sub
if(line_pos) ogg_sub.lines++;
if(!c || ogg_sub.lines>=SUB_MAX_TEXT) break; // EOL or TooMany
@@ -175,12 +175,12 @@ void demux_ogg_add_sub (char* packet) {
case '\n': // just ignore linefeeds for now
// their placement seems rather haphazard
break;
- case '<': // some html markup, ignore for now
+/* case '<': // some html markup, ignore for now
ignoring = 1;
break;
case '>':
ignoring = 0;
- break;
+ break;*/
default:
//if(!ignoring)
ogg_sub.text[ogg_sub.lines][line_pos++] = c;
diff -Nurp MPlayer-20020820-org/subreader.h MPlayer-20020820/subreader.h
--- MPlayer-20020820-org/subreader.h Wed Aug 21 13:02:57 2002
+++ MPlayer-20020820/subreader.h Wed Aug 21 15:25:23 2002
@@ -23,7 +23,7 @@ extern int sub_num; // number of
// One of the SUB_* constant above
extern int sub_format;
-#define SUB_MAX_TEXT 5
+#define SUB_MAX_TEXT 10
typedef struct {
More information about the MPlayer-users
mailing list