summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-29 23:23:10 +0100
committerCarl Hetherington <cth@carlh.net>2024-03-29 23:23:10 +0100
commita115088ca904a26d100e479a7fde21c9235bf7c9 (patch)
treefb21dea1726656f883eb9c1458f18ad16cebd9bd /src/lib
parent51a1cee215700b43fa20e12084b7987ef3b64b42 (diff)
parentbdcaf60ec37ec694f1e221a33b090f670bf974d6 (diff)
Merge remote-tracking branch 'origin/main' into v2.17.x
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_content.cc2
-rw-r--r--src/lib/ffmpeg_examiner.cc2
-rw-r--r--src/lib/video_content.cc9
-rw-r--r--src/lib/video_content.h2
4 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 8baa40c1b..c80bdec69 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -295,8 +295,10 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
_filters.push_back(*Filter::from_id("hflip"));
} else if (fabs (rot - 90) < 1.0) {
_filters.push_back(*Filter::from_id("90clock"));
+ video->rotate_size();
} else if (fabs (rot - 270) < 1.0) {
_filters.push_back(*Filter::from_id("90anticlock"));
+ video->rotate_size();
}
}
if (examiner->has_alpha()) {
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index 583ea1297..f7d3f9df3 100644
--- a/src/lib/ffmpeg_examiner.cc
+++ b/src/lib/ffmpeg_examiner.cc
@@ -173,8 +173,6 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo
/* This code taken from get_rotation() in ffmpeg:cmdutils.c */
auto stream = _format_context->streams[*_video_stream];
auto rotate_tag = av_dict_get (stream->metadata, "rotate", 0, 0);
- _rotation = 0;
-
if (rotate_tag && *rotate_tag->value && strcmp(rotate_tag->value, "0")) {
char *tail;
_rotation = av_strtod (rotate_tag->value, &tail);
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index e84462ed2..10dd5ff1e 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -724,3 +724,12 @@ VideoContent::actual_crop () const
);
}
+
+void
+VideoContent::rotate_size()
+{
+ if (_size) {
+ std::swap(_size->width, _size->height);
+ }
+}
+
diff --git a/src/lib/video_content.h b/src/lib/video_content.h
index a7b630b14..eb106cc75 100644
--- a/src/lib/video_content.h
+++ b/src/lib/video_content.h
@@ -220,6 +220,8 @@ public:
void modify_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const;
void modify_trim_start (dcpomatic::ContentTime& pos) const;
+ void rotate_size();
+
static std::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtr node, int version, VideoRange video_range_hint);
private: