Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/video_player_avplay/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## NEXT
## 0.8.2

* Adds compatibility with `http` 1.0 in example.
* Removed unused proxy APIs.
* Update plusplayer
1. [DASH] Fix subtitle crash issue.

## 0.8.1

Expand Down
2 changes: 1 addition & 1 deletion packages/video_player_avplay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To use this package, add `video_player_avplay` as a dependency in your `pubspec.

```yaml
dependencies:
video_player_avplay: ^0.8.1
video_player_avplay: ^0.8.2
```

Then you can import `video_player_avplay` in your Dart code:
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player_avplay/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player_avplay
description: Flutter plugin for displaying inline video on Tizen TV devices.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/video_player_avplay
version: 0.8.1
version: 0.8.2

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 12 additions & 3 deletions packages/video_player_avplay/tizen/src/plus_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,7 @@ void PlusPlayer::OnSubtitleData(char *data, const int size,
}

if (type == plusplayer::SubtitleType::kPicture) {
#ifdef PICTURE_SUBTITLE_SUPPORT
if (picture_width <= 0 || picture_height <= 0 || size <= 0) {
LOG_ERROR(
"[PlusPlayer] Invalid picture dimensions or size: size: %d, width: "
Expand All @@ -1328,9 +1329,16 @@ void PlusPlayer::OnSubtitleData(char *data, const int size,

int subtitle_mem_length = 0;
int channels = size / area;
unsigned char *subtitle_png =
stbi_write_png_to_mem((const unsigned char *)data, 0, picture_width,
picture_height, channels, &subtitle_mem_length);
if (channels < 1 || channels > 4) {
LOG_ERROR("[PlusPlayer] Invalid number of channels: %d", channels);
return;
}
int stride_in_bytes = static_cast<int>(picture_width) * channels;

unsigned char *subtitle_png = stbi_write_png_to_mem(
(const unsigned char *)data, stride_in_bytes,
static_cast<int>(picture_width), static_cast<int>(picture_height),
channels, &subtitle_mem_length);

if (subtitle_png && subtitle_mem_length > 0) {
std::vector<uint8_t> picture(subtitle_png,
Expand All @@ -1349,6 +1357,7 @@ void PlusPlayer::OnSubtitleData(char *data, const int size,
} else {
LOG_ERROR("[PlusPlayer] Picture subtitle data is null or size is 0.");
}
#endif
} else {
LOG_INFO(
"[PlusPlayer] Subtitle is text: duration: %llu, text: %s, type: %d",
Expand Down