diff --git a/win-dshow-replay.cpp b/win-dshow-replay.cpp index b00f375..939f5bf 100644 --- a/win-dshow-replay.cpp +++ b/win-dshow-replay.cpp @@ -172,6 +172,7 @@ struct DShowReplayInput { VideoConfig videoConfig; AudioConfig audioConfig; + video_range_type range; obs_source_frame2 frame; obs_source_audio audio; @@ -642,7 +643,7 @@ void DShowReplayInput::OnEncodedVideoData(enum AVCodecID id, bool got_output; bool success = ffmpeg_decode_video(video_decoder, data, size, &ts, - &frame, &got_output); + range, &frame, &got_output); if (!success) { blog(LOG_WARNING, "Error decoding video"); return; @@ -1245,15 +1246,14 @@ inline bool DShowReplayInput::Activate(obs_data_t *settings) if (!device.ConnectFilters()) return false; - enum video_colorspace cs = GetColorSpace(settings); - - video_range_type range = GetColorRange(settings); - frame.range = GetColorRange(settings); - if (device.Start() != Result::Success) return false; - bool success = video_format_get_parameters(cs, frame.range, + enum video_colorspace cs = GetColorSpace(settings); + range = GetColorRange(settings); + frame.range = range; + + bool success = video_format_get_parameters(cs, range, frame.color_matrix, frame.color_range_min, frame.color_range_max);