changeset 22913:07ecf1d8922e

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/
author eugeni
date Sat, 07 Apr 2007 13:32:51 +0000
parents 20c5536265da
children 29827d88d2da
files libass/ass_render.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;