Fix lost hard linebreaks in libass by repeating the loop when both soft and
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 7 Apr 2007 13:32:51 +0000 (13:32 +0000)
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 7 Apr 2007 13:32:51 +0000 (13:32 +0000)
hard linebreaks are about to be added.

Original message:
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2007-April/050876.html

Patch by Jindrich Makovicka /makovick gmail com/

git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@22931 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass_render.c

index 4532cab..a757c2d 100644 (file)
@@ -1385,6 +1385,11 @@ static void wrap_lines_smart(int max_text_width)
                
                if (cur->symbol == ' ')
                        last_space = i;
+
+               // make sure the hard linebreak is not forgotten when
+               // there was a new soft linebreak just inserted
+               if (cur->symbol == '\n' && break_type == 1)
+                       i--;
        }
 #define DIFF(x,y) (((x) < (y)) ? (y - x) : (x - y))
        exit = 0;