diff options
author | atlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-08 14:10:22 +0000 |
---|---|---|
committer | atlka <atlka@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-01-08 14:10:22 +0000 |
commit | 61bcfde0a0d648b531f47134c53e63e8ea97f436 (patch) | |
tree | 5b229bd7e4ff25d28cae1bb43cad4b9327fd2903 /subreader.c | |
parent | 723e6e76b3623f22fa30fae382304d8a23fe19a1 (diff) | |
download | mpv-61bcfde0a0d648b531f47134c53e63e8ea97f436.tar.bz2 mpv-61bcfde0a0d648b531f47134c53e63e8ea97f436.tar.xz |
corrections to adjust_subs_time function which now uses fps if needed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4053 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r-- | subreader.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/subreader.c b/subreader.c index d19d1de220..807a519695 100644 --- a/subreader.c +++ b/subreader.c @@ -599,19 +599,20 @@ subtitle* subcp_recode (subtitle *sub) #endif -static void adjust_subs_time(subtitle* sub, unsigned long subtime){ - int i = sub_num; +void adjust_subs_time(subtitle* sub, float subtime, float fps){ subtitle* nextsub; + int i = sub_num; + unsigned long subfms = (sub_uses_time ? 100 : fps) * subtime; - for (;;){ + if (i) for (;;){ if (sub->end <= sub->start) - sub->end = sub->start + subtime; + sub->end = sub->start + subfms; if (!--i) return; nextsub = sub + 1; if (sub->end >= nextsub->start){ sub->end = nextsub->start - 1; - if (sub->end - sub->start > subtime) - sub->end = sub->start + subtime; + if (sub->end - sub->start > subfms) + sub->end = sub->start + subfms; } sub = nextsub; } @@ -682,11 +683,6 @@ subtitle* sub_read_file (char *filename) { return NULL; } -// if sub->end time is 0 set it to sub_>start + ~6 sec but not -// after next sub->start time -// correct also if sub->end time is below sub->start time -// maybe default subtime (150fms) should be a program option AST - adjust_subs_time(first, 150); return first; } |