diff --git a/src/demux/mod.rs b/src/demux/mod.rs index cf7168c..7faa5cb 100644 --- a/src/demux/mod.rs +++ b/src/demux/mod.rs @@ -3,6 +3,7 @@ mod flv; use std::sync::mpsc; use std::error::Error; +use std::thread; use crate::util; use crate::demux::input::FileReader; @@ -18,8 +19,11 @@ pub fn spawn() -> Result< > { let mut reader = input::new_reader()?; let metadata = reader.init()?; - let (_v_in, v_out) = mpsc::channel(); - let (_a_in, a_out) = mpsc::channel(); - let (_err_in, err_out) = mpsc::channel(); + let (v_in, v_out) = mpsc::channel(); + let (a_in, a_out) = mpsc::channel(); + let (err_in, err_out) = mpsc::channel(); + thread::spawn(move || { + reader.data_loop(v_in, a_in, &metadata, err_in); + }); return Ok((v_out, a_out, metadata, err_out)); }