From 570fae40173fc1b67c5f41c44960c48e61d1d677 Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Fri, 6 Oct 2023 14:55:04 +0500 Subject: [PATCH] basic demux read loop (broken) --- src/demux/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)); }