diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-04-08 00:43:28 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-04-08 00:43:28 +0200 |
| commit | eeaca1992aa117fe3a2a4a079d8a20a01d88e933 (patch) | |
| tree | 5dba1c017aad02ee0087d2b4daffe09490e86c74 /src/lib/ffmpeg_content.cc | |
| parent | 769d56b7f3b2fe78036b4ba12c0cfe71734b379d (diff) | |
Guess video range better when importing 2.14.x projects (#2227).
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 9017ad605..c791309ad 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -90,7 +90,11 @@ get_optional_enum (cxml::ConstNodePtr node, string name) FFmpegContent::FFmpegContent (cxml::ConstNodePtr node, int version, list<string>& notes) : Content (node) { - video = VideoContent::from_xml (this, node, version); + _color_range = get_optional_enum<AVColorRange>(node, "ColorRange"); + + VideoRange const video_range_hint = (_color_range && *_color_range == AVCOL_RANGE_JPEG) ? VideoRange::FULL : VideoRange::VIDEO; + + video = VideoContent::from_xml (this, node, version, video_range_hint); audio = AudioContent::from_xml (this, node, version); text = TextContent::from_xml (this, node, version, notes); @@ -124,7 +128,6 @@ FFmpegContent::FFmpegContent (cxml::ConstNodePtr node, int version, list<string> _first_video = ContentTime (f.get ()); } - _color_range = get_optional_enum<AVColorRange>(node, "ColorRange"); _color_primaries = get_optional_enum<AVColorPrimaries>(node, "ColorPrimaries"); _color_trc = get_optional_enum<AVColorTransferCharacteristic>(node, "ColorTransferCharacteristic"); _colorspace = get_optional_enum<AVColorSpace>(node, "Colorspace"); |
