From 7b1d15267716f0be6b7c9d86f64074d8f2d17f41 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Sat, 1 Apr 2006 15:21:13 +0000 Subject: [PATCH] Originally committed to SVN as r285. --- core/subtitle_format_prs.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/subtitle_format_prs.cpp b/core/subtitle_format_prs.cpp index 57c8b7877..d184c24be 100644 --- a/core/subtitle_format_prs.cpp +++ b/core/subtitle_format_prs.cpp @@ -412,7 +412,8 @@ std::vector PRSSubtitleFormat::GetFrameRanges() { size_t end = VFR_Output.GetFrameAtTime(diag->End.GetMS(),false); // Ensure that the vector is long enough - if (frames.size() <= end) frames.resize(end+1); + // Yes, +2, this is an optimization for something below + if (frames.size() <= end) frames.resize(end+2); // Fill data // 2 = Store this frame @@ -439,6 +440,9 @@ std::vector PRSSubtitleFormat::GetFrameRanges() { frames[i] = 1; } } + + // Ends right before another "1" block, so make this a "2" + if (i == end && frames[i+1] == 1) frames[i] = 2; } // Clean up