From 3a46d0559dea6ae6ee073b389fff83fbc871b76e Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Tue, 10 Oct 2023 16:01:00 +0500 Subject: [PATCH] change nalu handling, allow different handling for flv and mpegts --- src/demux/flv.rs | 6 +++--- src/demux/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/demux/flv.rs b/src/demux/flv.rs index b077b66..a23f4b8 100644 --- a/src/demux/flv.rs +++ b/src/demux/flv.rs @@ -4,7 +4,7 @@ use std::io::Read; use crate::util; use crate::demux::input; -use crate::demux::nalu; +use crate::demux::nalu_flv as nalu; enum FLVTagType { Metadata, @@ -87,11 +87,11 @@ impl input::FileReader for FLVReader { return match packet_type { FLVTagType::Audio => Ok(util::NALUPacket { packet_type: util::NALUPacketType::Audio, - packet_data: nalu::prepend_a_flv(data, &metadata), + packet_data: nalu::prepend_a(data, &metadata), }), FLVTagType::Video => Ok(util::NALUPacket { packet_type: util::NALUPacketType::Video, - packet_data: nalu::prepend_v_flv(data, &metadata), + packet_data: nalu::prepend_v(data, &metadata), }), _ => Err(Box::new(util::DemuxerError::FLVUnexpectedTag)) }; diff --git a/src/demux/mod.rs b/src/demux/mod.rs index 604d10f..5240f7b 100644 --- a/src/demux/mod.rs +++ b/src/demux/mod.rs @@ -1,6 +1,6 @@ mod input; mod flv; -mod nalu; +mod nalu_flv; use std::sync::mpsc; use std::error::Error;