From a2ace0d1b3b88f0383e1f0e28464727980f772e2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 3 Mar 2010 19:11:31 +0100 Subject: [PATCH] Skip empty lines at the beginning of SRT files --- ChangeLog | 5 +++++ src/input/subtitles.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 975c4af57..63b84a8d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-03-03 Moritz Bunkus + + * mkvmerge: bug fix: The SRT reader skips empty lines at the + beginning of the file. + 2010-03-02 Moritz Bunkus * Build system: bug fix: Fixed the configure script and compilation diff --git a/src/input/subtitles.cpp b/src/input/subtitles.cpp index c4ee76bce..dc46eca87 100644 --- a/src/input/subtitles.cpp +++ b/src/input/subtitles.cpp @@ -44,8 +44,11 @@ bool srt_parser_c::probe(mm_text_io_c *io) { try { io->setFilePointer(0, seek_beginning); - std::string s = io->getline(); - strip(s); + std::string s; + do { + s = io->getline(); + strip(s); + } while (s.empty()); int64_t dummy; if (!parse_int(s, dummy))