2018-06-09 Carl Hetherington <cth@carlh.net>
+ * Fix bad parsing of ASS lines embedded into FFmpeg files
+ and containing commas.
+
* Add option to open a DCP in the player (#1312).
-a2018-06-08 Carl Hetherington <cth@carlh.net>
+2018-06-08 Carl Hetherington <cth@carlh.net>
* Add support for rotation and flipping of video sources,
and auto-detect when this is necessary (#966).
produces a single format of Dialogue: lines...
*/
- vector<string> bits;
- split (bits, ass, is_any_of (","));
- if (bits.size() < 10) {
+ int commas = 0;
+ string text;
+ for (size_t i = 0; i < ass.length(); ++i) {
+ if (commas < 9 && ass[i] == ',') {
+ ++commas;
+ } else if (commas == 9) {
+ text += ass[i];
+ }
+ }
+
+ if (text.empty ()) {
return;
}
sub::RawSubtitle base;
list<sub::RawSubtitle> raw = sub::SSAReader::parse_line (
base,
- bits[9],
+ text,
_ffmpeg_content->video->size().width,
_ffmpeg_content->video->size().height
);