Skip to content

Commit

Permalink
Resetting buffers on rewind
Browse files Browse the repository at this point in the history
  • Loading branch information
asticode committed Nov 26, 2017
1 parent c53695d commit 041ea73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demuxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ func (dmx *Demuxer) NextData() (d *Data, err error) {

// Rewind rewinds the demuxer reader
func (dmx *Demuxer) Rewind() (n int64, err error) {
dmx.dataBuffer = []*Data{}
dmx.packetBuffer = newPacketBuffer()
if s, ok := dmx.r.(io.Seeker); ok {
if n, err = s.Seek(0, 0); err != nil {
err = errors.Wrap(err, "astits: seeking to 0 failed")
Expand Down

0 comments on commit 041ea73

Please sign in to comment.