Skip to content

Commit 8613c4a

Browse files
authored
chore: prepare v1.60 release (#83)
* chore: bump version * fix: extra parens * docs: add more detail to Duration() and DurationTicks()
1 parent 3ef1414 commit 8613c4a

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Taskfile.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: "3"
33

44
vars:
5-
VERSION: "v1.5.1"
5+
VERSION: "v1.6.0"
66

77
tasks:
88
clean:

pkg/scte35/scte35.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func DurationToTicks(d time.Duration) uint64 {
9292

9393
// TicksToDuration converts 90kHz ticks to a duration.
9494
func TicksToDuration(ticks uint64) time.Duration {
95-
return time.Duration(math.Round((float64(ticks) / TicksPerNanosecond)))
95+
return time.Duration(math.Round(float64(ticks) / TicksPerNanosecond))
9696
}
9797

9898
// BreakDuration specifies the duration of the commercial break(s). It may be

pkg/scte35/splice_info_section.go

+12
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ func (sis *SpliceInfoSection) Decode(b []byte) (err error) {
145145
}
146146

147147
// DurationTicks attempts to return the duration of the signal in ticks.
148+
//
149+
// This method returns the splice insert's break_duration or the first valid
150+
// segmentation_duration found among the available splice descriptors.
151+
//
152+
// This method is not recommended for cases where segmentation_descriptors
153+
// contain conflicting segmentation_durations.
148154
func (sis *SpliceInfoSection) DurationTicks() uint64 {
149155
// if this is a splice insert with a duration, use it
150156
if sc, ok := sis.SpliceCommand.(*SpliceInsert); ok {
@@ -165,6 +171,12 @@ func (sis *SpliceInfoSection) DurationTicks() uint64 {
165171
}
166172

167173
// Duration attempts to return the duration of the signal.
174+
//
175+
// This method returns the splice insert's break_duration or the first valid
176+
// segmentation_duration found among the available splice descriptors.
177+
//
178+
// This method is not recommended for cases where segmentation_descriptors
179+
// contain conflicting segmentation_durations.
168180
func (sis *SpliceInfoSection) Duration() time.Duration {
169181
return TicksToDuration(sis.DurationTicks())
170182
}

0 commit comments

Comments
 (0)