[MPlayer-dev-eng] [PATCH] small ogg softsub fixes

Piotr Krukowiecki piotr at pingu.ii.uj.edu.pl
Sat Aug 24 20:43:23 CEST 2002


Hi

Attached patch 
- fixes problems when new line is just '\n' and not '\r\n'.
- disables code that removes html tags from subs (the code was not
  functional anyway)
- increases SUB_MAX_TEXT. I have movie that has 6 lines of text in one
  scene.

 
BTW, how much base64 attachements are enforced?


-- 
Piotrek  (@ ~)
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-dev-eng mailing list