Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
Fix rotation degree calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
wangqr committed Oct 29, 2019
1 parent ba9da43 commit 2375963
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video_provider_ffmpegsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) {
out.data[4 * (Width * x + y) + ch] = data[frame->Linesize[0] * (Height - 1 - x) + 4 * (Width - 1 - y) + ch];
out.pitch = 4 * Width;
}
else if (VideoInfo->Rotation % 180 == 90 || VideoInfo->Rotation % 360 == -270) {
else if (VideoInfo->Rotation % 360 == 90 || VideoInfo->Rotation % 360 == -270) {
std::vector<unsigned char> data(std::move(out.data));
out.data.resize(Width * Height * 4);
for (int x = 0; x < Width; ++x)
Expand All @@ -362,7 +362,7 @@ void FFmpegSourceVideoProvider::GetFrame(int n, VideoFrame &out) {
out.height = Width;
out.pitch = 4 * Height;
}
else if (VideoInfo->Rotation % 180 == 270 || VideoInfo->Rotation % 360 == -90) {
else if (VideoInfo->Rotation % 360 == 270 || VideoInfo->Rotation % 360 == -90) {
std::vector<unsigned char> data(std::move(out.data));
out.data.resize(Width * Height * 4);
for (int x = 0; x < Width; ++x)
Expand Down

0 comments on commit 2375963

Please sign in to comment.