Skip to content

Commit

Permalink
Fixed WebVTT rlm and lrm
Browse files Browse the repository at this point in the history
  • Loading branch information
CastagnaIT committed Dec 30, 2019
1 parent 5f9aa91 commit d4fe62e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/parser/WebVTT.cpp
Expand Up @@ -17,6 +17,7 @@
*/

#include "WebVTT.h"
#include "../helpers.h"
#include <cstring>

bool WebVTT::Parse(uint64_t pts, uint32_t duration, const void *buffer, size_t buffer_size, uint64_t timescale, uint64_t ptsOffset)
Expand Down Expand Up @@ -111,10 +112,8 @@ bool WebVTT::Parse(uint64_t pts, uint32_t duration, const void *buffer, size_t b
strText = std::string(cbuf, next - cbuf);
if (!strText.empty() && strText.back() == '\r')
strText.resize(strText.size() - 1);
if (strText.find("&rlm;", 0, 5) == 0)
strText.replace(0, 5, "\0xE2\0x80\0xAB");
else if (strText.find("&lrm;", 0, 5) == 0)
strText.replace(0, 5, "\0xE2\0x80\0xAA");
replace_string(strText, "&rlm;", "\xE2\x80\xAB");
replace_string(strText, "&lrm;", "\xE2\x80\xAA");
if (!strText.empty())
m_subTitles.back().text.push_back(strText);
else
Expand Down

0 comments on commit d4fe62e

Please sign in to comment.