Skip to content

Commit

Permalink
Fix passthrough_decoders.rs after changes in RustAudio/ogg#25
Browse files Browse the repository at this point in the history
Signed-off-by: Christian König <ckoenig@posteo.de>
  • Loading branch information
yubiuser committed Apr 2, 2023
1 parent c18da0b commit 1be0ac9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions playback/src/decoder/passthrough_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
MS_PER_PAGE, PAGES_PER_MS,
};

fn get_header<T>(code: u8, rdr: &mut PacketReader<T>) -> DecoderResult<Box<[u8]>>
fn get_header<T>(code: u8, rdr: &mut PacketReader<T>) -> DecoderResult<Vec<u8>>
where
T: Read + Seek,
{
Expand All @@ -34,14 +34,14 @@ where

pub struct PassthroughDecoder<R: Read + Seek> {
rdr: PacketReader<R>,
wtr: PacketWriter<Vec<u8>>,
wtr: PacketWriter<'static, Vec<u8>>,
eos: bool,
bos: bool,
ofsgp_page: u64,
stream_serial: u32,
ident: Box<[u8]>,
comment: Box<[u8]>,
setup: Box<[u8]>,
ident: Vec<u8>,
comment: Vec<u8>u8,
setup: Vec<u8>,
}

impl<R: Read + Seek> PassthroughDecoder<R> {
Expand Down Expand Up @@ -87,7 +87,7 @@ impl<R: Read + Seek> PassthroughDecoder<R> {
}
}

impl<R: Read + Seek> AudioDecoder for PassthroughDecoder<R> {
impl< R: Read + Seek> AudioDecoder for PassthroughDecoder<R> {
fn seek(&mut self, position_ms: u32) -> Result<u32, DecoderError> {
let absgp = (position_ms as f64 * PAGES_PER_MS) as u64;

Expand All @@ -98,7 +98,7 @@ impl<R: Read + Seek> AudioDecoder for PassthroughDecoder<R> {
let absgp_page = pck.absgp_page() - self.ofsgp_page;
self.wtr
.write_packet(
pck.data.into_boxed_slice(),
pck.data,
self.stream_serial,
PacketWriteEndInfo::EndStream,
absgp_page,
Expand Down Expand Up @@ -196,7 +196,7 @@ impl<R: Read + Seek> AudioDecoder for PassthroughDecoder<R> {

self.wtr
.write_packet(
pck.data.into_boxed_slice(),
pck.data,
self.stream_serial,
inf,
pckgp_page - self.ofsgp_page,
Expand Down

0 comments on commit 1be0ac9

Please sign in to comment.