diff options
-rw-r--r-- | stream/src/fragment.rs | 5 | ||||
-rw-r--r-- | web/script/player/player.ts | 4 | ||||
-rw-r--r-- | web/script/player/types_stream.ts | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/stream/src/fragment.rs b/stream/src/fragment.rs index 3b4bb0f..a14732b 100644 --- a/stream/src/fragment.rs +++ b/stream/src/fragment.rs @@ -60,7 +60,7 @@ pub fn fragment_stream( .ok_or(anyhow!("fragment index out of range"))? .position; - let cluster = { + let mut cluster = { let media_file = File::open(media_path)?; let mut media = create_demuxer_autodetect(Box::new(media_file))? .ok_or(anyhow!("media container unknown"))?; @@ -71,6 +71,9 @@ pub fn fragment_stream( .1 }; + cluster.simple_blocks.retain(|b| b.track == track_num); + cluster.block_groups.retain(|b| b.block.track == track_num); + let jr_container = match container { StreamContainer::WebM => ContainerFormat::Webm, StreamContainer::Matroska => ContainerFormat::Matroska, diff --git a/web/script/player/player.ts b/web/script/player/player.ts index 210ce9a..2991d27 100644 --- a/web/script/player/player.ts +++ b/web/script/player/player.ts @@ -109,9 +109,9 @@ export class Player { this.set_pers() //! bad code: assignment order is important because chapter callbacks use duration - this.duration.value = streaminfo.segments[0].duration + this.duration.value = streaminfo.duration this.streaminfo = streaminfo - this.tracks = streaminfo!.segments[0].tracks; + this.tracks = streaminfo!.tracks; console.log("aaa", this.tracks); this.video.src = URL.createObjectURL(this.media_source) this.media_source.addEventListener("sourceopen", async () => { diff --git a/web/script/player/types_stream.ts b/web/script/player/types_stream.ts index bff4ed8..54c392a 100644 --- a/web/script/player/types_stream.ts +++ b/web/script/player/types_stream.ts @@ -10,10 +10,6 @@ export interface SubtitleCue extends TimeRange { } export interface StreamInfo { name?: string, - segments: SegmentInfo[], -} -export interface SegmentInfo { - name?: string, duration: number, tracks: TrackInfo[], } |