X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_content.cc;h=3cd9d66e2e1c5d034e3510c5475af2b508ba8e17;hb=d66bcea066deb3b3cd919a69aab7e2078fb52ca8;hp=44e1b2afb22363499a8b5d9c0b772ade907c1931;hpb=de2af791bdfdcd653752cba970e59efc7bf810c7;p=dcpomatic.git diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 44e1b2afb..3cd9d66e2 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -243,7 +243,6 @@ FFmpegContent::examine (shared_ptr job) if (examiner->has_video ()) { video.reset (new VideoContent (this)); video->take_from_examiner (examiner); - set_default_colour_conversion (); } boost::filesystem::path first_path = path (0); @@ -281,6 +280,10 @@ FFmpegContent::examine (shared_ptr job) } + if (examiner->has_video ()) { + set_default_colour_conversion (); + } + signal_changed (FFmpegContentProperty::SUBTITLE_STREAMS); signal_changed (FFmpegContentProperty::SUBTITLE_STREAM); } @@ -420,10 +423,29 @@ FFmpegContent::set_default_colour_conversion () boost::mutex::scoped_lock lm (_mutex); - if (s.width < 1080) { - video->set_colour_conversion (PresetColourConversion::from_id ("rec601").conversion); - } else { + switch (_colorspace) { + case AVCOL_SPC_RGB: + video->set_colour_conversion (PresetColourConversion::from_id ("srgb").conversion); + break; + case AVCOL_SPC_BT709: video->set_colour_conversion (PresetColourConversion::from_id ("rec709").conversion); + break; + case AVCOL_SPC_BT470BG: + case AVCOL_SPC_SMPTE170M: + case AVCOL_SPC_SMPTE240M: + video->set_colour_conversion (PresetColourConversion::from_id ("rec601").conversion); + break; + case AVCOL_SPC_BT2020_CL: + case AVCOL_SPC_BT2020_NCL: + video->set_colour_conversion (PresetColourConversion::from_id ("rec2020").conversion); + break; + default: + if (s.width < 1080) { + video->set_colour_conversion (PresetColourConversion::from_id ("rec601").conversion); + } else { + video->set_colour_conversion (PresetColourConversion::from_id ("rec709").conversion); + } + break; } }