|
17 | 17 | #define STB_IMAGE_WRITE_IMPLEMENTATION |
18 | 18 | #include "stb_image_write.h" |
19 | 19 |
|
| 20 | +#define SUBTITLE_ATTR_TYPE_COUNT 37 |
| 21 | + |
20 | 22 | namespace video_player_avplay_tizen { |
21 | 23 |
|
22 | 24 | static std::vector<std::string> split(const std::string &s, char delim) { |
@@ -1175,7 +1177,8 @@ void PlusPlayer::OnSubtitleData(char *data, const int size, |
1175 | 1177 | text_lines_count = text_lines.size(); |
1176 | 1178 | } |
1177 | 1179 |
|
1178 | | - std::vector<int> line_attr_index(37, text_lines_count - 1); |
| 1180 | + std::vector<int> line_attr_index(SUBTITLE_ATTR_TYPE_COUNT, |
| 1181 | + text_lines_count - 1); |
1179 | 1182 |
|
1180 | 1183 | // Pre-parse attributes to find width/height for picture subtitles. |
1181 | 1184 | double picture_width = 0.0; |
@@ -1276,19 +1279,9 @@ void PlusPlayer::OnSubtitleData(char *data, const int size, |
1276 | 1279 | break; |
1277 | 1280 | } |
1278 | 1281 |
|
1279 | | - // TODO |
1280 | | - if (attr->type != plusplayer::kSubAttrFontFamily) { |
1281 | | - int index = line_attr_index[attr->type]--; |
1282 | | - if (index >= 0) { |
1283 | | - attributes_lines[index].push_back(flutter::EncodableValue(attributes)); |
1284 | | - } |
1285 | | - } else { |
1286 | | - if (line_attr_index[attr->type] == 0) { |
1287 | | - for (int i = 0; i < text_lines_count; i++) { |
1288 | | - attributes_lines[i].push_back(flutter::EncodableValue(attributes)); |
1289 | | - } |
1290 | | - } |
1291 | | - line_attr_index[attr->type]--; |
| 1282 | + int index = line_attr_index[attr->type]--; |
| 1283 | + if (index >= 0) { |
| 1284 | + attributes_lines[index].push_back(flutter::EncodableValue(attributes)); |
1292 | 1285 | } |
1293 | 1286 | } |
1294 | 1287 |
|
|
0 commit comments