aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-rad/src/demuxers/smacker.rs
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-10-04 11:53:21 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-10-04 11:53:21 +0200
commita480a0de101483d802a11e72d758dae00fa4860a (patch)
treeb433ba04fc397f6e7297aeb56103105254dcb3f7 /nihav-rad/src/demuxers/smacker.rs
parentb4bf2c3f1a94b2b4ebbfc704e17fbaf366f8fa8b (diff)
downloadnihav-a480a0de101483d802a11e72d758dae00fa4860a.tar.gz
introduce stream and container duration
Diffstat (limited to 'nihav-rad/src/demuxers/smacker.rs')
-rw-r--r--nihav-rad/src/demuxers/smacker.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/nihav-rad/src/demuxers/smacker.rs b/nihav-rad/src/demuxers/smacker.rs
index 5580a87..340af85 100644
--- a/nihav-rad/src/demuxers/smacker.rs
+++ b/nihav-rad/src/demuxers/smacker.rs
@@ -56,7 +56,7 @@ impl AudioTrack {
let soniton = if (self.flags & SMK_AUD_FLAG_16BIT) != 0 { SND_S16_FORMAT } else { SND_U8_FORMAT };
let ahdr = NAAudioInfo::new(self.srate, channels, soniton, 1);
let ainfo = NACodecInfo::new(codecname, NACodecTypeInfo::Audio(ahdr), None);
- let res = strmgr.add_stream(NAStream::new(StreamType::Audio, (str_id + 1) as u32, ainfo, 1, self.srate));
+ let res = strmgr.add_stream(NAStream::new(StreamType::Audio, (str_id + 1) as u32, ainfo, 1, self.srate, 0));
validate!(res.is_some());
self.id = res.unwrap();
@@ -149,7 +149,7 @@ impl<'a> DemuxCore<'a> for SmackerVideoDemuxer<'a> {
let vhdr = NAVideoInfo::new(width, height, false, PAL8_FORMAT);
let vinfo = NACodecInfo::new("smacker-video", NACodecTypeInfo::Video(vhdr), Some(treedata));
- let res = strmgr.add_stream(NAStream::new(StreamType::Video, 0, vinfo, 1, 100000));
+ let res = strmgr.add_stream(NAStream::new(StreamType::Video, 0, vinfo, 1, 100000, 0));
validate!(res.is_some());
self.video_id = res.unwrap();
@@ -267,6 +267,7 @@ impl<'a> DemuxCore<'a> for SmackerVideoDemuxer<'a> {
}
Err(DemuxerError::NotImplemented)
}
+ fn get_duration(&self) -> u64 { self.frames as u64 * self.pts_inc / 100 }
}
impl<'a> NAOptionHandler for SmackerVideoDemuxer<'a> {