subsync

cli tool to synchronize srt subtitles automatically
git clone git://git.2f30.org/subsync
Log | Files | Refs | README | LICENSE

commit 8f9a6b18bcd6bd0f2ca92a72e9f2fc50bc7340b6
parent eed8847ade24709c7f8b32f00ffe425d95250fa4
Author: oblique <psyberbits@gmail.com>
Date:   Wed, 24 Apr 2013 21:06:11 +0300

remove subtitle id parsing

Diffstat:
Msubsync.go | 18+++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/subsync.go b/subsync.go @@ -4,7 +4,6 @@ import ( "fmt" "errors" "strings" - "strconv" "math" "os" "path" @@ -111,19 +110,12 @@ func read_srt(filename string) (*list.List, error) { ln = append(ln, line...) } - /* parse subtitle id */ if state == 0 { - /* avoid false-positive parsing error */ - if err == io.EOF && len(ln) == 0 { - break; - } - id := strings.Split(string(ln), " ") - if len(id) != 1 { - return nil, errors.New("Parsing error: Wrong file format") - } - _, err = strconv.ParseUint(id[0], 10, 0) - if err != nil { - return nil, errors.New("Parsing error: Wrong file format") + if len(ln) == 0 { + if err == io.EOF { + break; + } + continue; } state = 1 /* parse start, end times */