Skip to content

Commit b99cd12

Browse files
committed
fix(audio): rename Seek to SeekTo to resolve interface conflict
The Seek method signature conflicted with Go's standard io.Seeker interface, which expects Seek(int64, int) (int64, error). This method uses different semantics (timestamp-based seeking rather than byte-offset seeking), making the name conflict confusing. Renaming to SeekTo clarifies the intent and eliminates the interface signature mismatch caught by go vet. - Rename Seek(int64) error to SeekTo(int64) error in reader.go - Update call site in analyzer_output.go Signed-off-by: Martin Wimpress <code@wimpress.io>
1 parent 7f71743 commit b99cd12

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

internal/audio/reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (r *Reader) GetDecoderContext() *ffmpeg.AVCodecContext {
187187
// Seek seeks to the specified timestamp in AV_TIME_BASE units.
188188
// Use 0 to seek to the beginning of the file. After seeking, the decoder
189189
// buffers are flushed so that subsequent ReadFrame calls return fresh data.
190-
func (r *Reader) Seek(timestamp int64) error {
190+
func (r *Reader) SeekTo(timestamp int64) error {
191191
if _, err := ffmpeg.AVFormatSeekFile(r.fmtCtx, -1, math.MinInt64, timestamp, math.MaxInt64, 0); err != nil {
192192
return fmt.Errorf("failed to seek: %w", err)
193193
}

internal/processor/analyzer_output.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func MeasureOutputRegions(outputPath string, silenceRegion *SilenceRegion, speec
234234
if speechRegion != nil {
235235
if silenceRegion != nil {
236236
// Only need to seek if we already read through the file for silence
237-
if err := reader.Seek(0); err != nil {
237+
if err := reader.SeekTo(0); err != nil {
238238
debugLog("Warning: Failed to seek for speech region measurement: %v", err)
239239
return silenceMetrics, nil
240240
}

0 commit comments

Comments
 (0)