diff --git a/NEWS.md b/NEWS.md index a61d2c35c..960439eeb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,9 @@ files even if the `clip_codec_identifier` playlist item field is not set to `M2TS` in the MPLS file. Fixes #2601. * all: fixed the spelling of the H.264 & H.265 codec names. +* mkvmerge: fixed handling of text files that use both DOS-style and + Unix-style line endings resulting in problems such as text subtitle files + not being parsed correctly. Fixes #2594. # Version 35.0.0 "All The Love In The World" 2019-06-22 diff --git a/src/common/mm_text_io.cpp b/src/common/mm_text_io.cpp index 3e24e8b5b..8979ae5f2 100644 --- a/src/common/mm_text_io.cpp +++ b/src/common/mm_text_io.cpp @@ -246,7 +246,7 @@ mm_text_io_c::getline(boost::optional max_chars) { continue; } - if ((1 == len) && (utf8char[0] == '\n') && (!p->uses_carriage_returns || previous_was_carriage_return)) + if ((1 == len) && (utf8char[0] == '\n')) return s; if (previous_was_carriage_return) { diff --git a/tests/results.txt b/tests/results.txt index d4f76b3ab..b77b78689 100644 --- a/tests/results.txt +++ b/tests/results.txt @@ -518,3 +518,4 @@ T_669ssa_ass_zero_duration:1bbca62bfcc25b7480e8bbfb228f510e-c34beca52c9bf3eac07c T_670h265_interlaced:720x480+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080+1920x1080:passed:20190126-134743:0.040331695 T_671emojis:063f1c31e5ba1046edd225f387eb0d81-true:passed:20190312-202232:0.016691955 T_672codec_name:8548fda1649436cf8036dfdb32be369c-true:passed:20190617-195042:0.027569471 +T_673srt_different_eol_styles:c1932566efe7110914a21720fc1ac69f:passed:20190810-160539:0.070217493 diff --git a/tests/test-673srt_different_eol_styles.rb b/tests/test-673srt_different_eol_styles.rb new file mode 100755 index 000000000..c2579f4ec --- /dev/null +++ b/tests/test-673srt_different_eol_styles.rb @@ -0,0 +1,5 @@ +#!/usr/bin/ruby -w + +# T_673srt_different_eol_styles +describe "mkvmerge / SRT text subtitles with both DOS & Unix style line endings" +test_merge "data/subtitles/srt/different_eol_styles.srt", :exit_code => :warning