# HG changeset patch # User eugeni # Date 1175952771 0 # Node ID 07ecf1d8922e2468af186a26221b81290e9a1cae # Parent 20c5536265daba59f2494ae0bb17cc4afcb19f80 Fix lost hard linebreaks in libass by repeating the loop when both soft and 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/ diff -r 20c5536265da -r 07ecf1d8922e libass/ass_render.c --- a/libass/ass_render.c Sat Apr 07 11:30:48 2007 +0000 +++ b/libass/ass_render.c Sat Apr 07 13:32:51 2007 +0000 @@ -1385,6 +1385,11 @@ 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;