From fc5f75dbb913322f63113c3796142173dee5579c Mon Sep 17 00:00:00 2001 From: gewlitys Date: Sat, 13 Sep 2003 15:41:14 +0000 Subject: [PATCH] Adjusted subtitle timings when there are no oggs (part of bug #362), from chmmravatar git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1228 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 2 ++ sc2/src/sc2code/libs/sound/trackplayer.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index e5e330365..0dd572f38 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.4: +- Adjusted subtitle timings when there are no oggs (part of bug #362), + from chmmravatar - Fixed crash in conversation summary and ffw/frew problem when selling data to Melnorme (bug #476), from chmmravatar - Flush input after selecting "Navigate" (bug #475) - Michael diff --git a/sc2/src/sc2code/libs/sound/trackplayer.c b/sc2/src/sc2code/libs/sound/trackplayer.c index b2183e240..5ed6e7f5d 100644 --- a/sc2/src/sc2code/libs/sound/trackplayer.c +++ b/sc2/src/sc2code/libs/sound/trackplayer.c @@ -215,7 +215,7 @@ GetTimeStamps(UNICODE *TimeStamps, sint32 *time_stamps) return (num); } -#define TEXT_SPEED 70 +#define TEXT_SPEED 80 UNICODE ** SplitSubPages (UNICODE *text, sint32 *timestamp, int *num_pages) { @@ -239,6 +239,8 @@ SplitSubPages (UNICODE *text, sint32 *timestamp, int *num_pages) wstrncpy (split_text[page] + ellips, text, pos); wstrcpy (split_text[page] + ellips + pos, "..."); timestamp[page] = - pos * TEXT_SPEED; + if (timestamp[page] > -1000) + timestamp[page] = -1000; ellips = 2; text = text + pos; pos = 0; @@ -252,6 +254,8 @@ SplitSubPages (UNICODE *text, sint32 *timestamp, int *num_pages) wstrncpy (split_text[page] + ellips, text, pos); *(split_text[page] + ellips + pos) = 0; timestamp[page] = - pos * TEXT_SPEED; + if (timestamp[page] > -1000) + timestamp[page] = -1000; ellips = 0; text = text + pos; pos = 0; @@ -276,6 +280,9 @@ SplitSubPages (UNICODE *text, sint32 *timestamp, int *num_pages) wstrncpy (split_text[page] + ellips, text, pos); *(split_text[page] + ellips + pos) = 0; timestamp[page] = - pos * TEXT_SPEED; + if (timestamp[page] > -1000) + timestamp[page] = -1000; + timestamp[page] += -1000; page ++; } *num_pages = page;