From 235dbc9b7b7d195d080a35eb5a8bebddac9703a1 Mon Sep 17 00:00:00 2001 From: nareix Date: Sat, 2 Apr 2016 18:38:55 +0800 Subject: [PATCH] change func name --- demuxer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/demuxer.go b/demuxer.go index 36d06d2..7d1b6df 100644 --- a/demuxer.go +++ b/demuxer.go @@ -321,10 +321,10 @@ func (self *Track) Duration() float64 { } func (self *Track) CurTime() float64 { - return self.TimeStampToTime(self.dts) + return self.TsToTime(self.dts) } -func (self *Track) CurTimeStamp() int64 { +func (self *Track) CurTs() int64 { return self.dts } @@ -342,7 +342,7 @@ func (self *Track) SeekToSampleIndex(index int) error { } func (self *Track) TimeToSampleIndex(time float64) int { - targetTs := self.TimeToTimeStamp(time) + targetTs := self.TimeToTs(time) targetIndex := 0 startTs := int64(0) @@ -381,11 +381,11 @@ func (self *Track) TimeToSampleIndex(time float64) int { return targetIndex } -func (self *Track) TimeToTimeStamp(time float64) int64 { +func (self *Track) TimeToTs(time float64) int64 { return int64(time*float64(self.TrackAtom.Media.Header.TimeScale)) } -func (self *Track) TimeStampToTime(ts int64) float64 { +func (self *Track) TsToTime(ts int64) float64 { return float64(ts)/float64(self.TrackAtom.Media.Header.TimeScale) }