Commit 8342b32c authored by Vittorio Giovara's avatar Vittorio Giovara

scenechange: Pass the only field needed to the constructor

parent 0984d76a
......@@ -355,7 +355,7 @@ impl Config {
packet_data: Vec::new(),
segment_start_idx: 0,
segment_start_frame: 0,
keyframe_detector: SceneChangeDetector::new(&self.video_info),
keyframe_detector: SceneChangeDetector::new(self.video_info.bit_depth),
config: *self,
}
}
......
......@@ -10,7 +10,6 @@
use encoder::Frame;
use std::sync::Arc;
use api::VideoDetails;
/// Detects fast cuts using changes in colour and intensity between frames.
/// Since the difference between frames is used, only fast cuts are detected
......@@ -41,9 +40,9 @@ impl Default for SceneChangeDetector {
}
impl SceneChangeDetector {
pub fn new(video_info: &VideoDetails) -> Self {
pub fn new(bit_depth: usize) -> Self {
let mut detector = Self::default();
detector.threshold = detector.threshold * video_info.bit_depth as u8 / 8;
detector.threshold = detector.threshold * bit_depth as u8 / 8;
detector
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment