Skip fix.

This commit is contained in:
zergon321
2021-08-26 01:44:29 +00:00
parent 77c304491b
commit ad87f614ff
2 changed files with 7 additions and 0 deletions

View File

@@ -5,4 +5,5 @@ type ErrorType int
const (
ErrorAgain ErrorType = -11
ErrorInvalidValue ErrorType = -22
ErrorEndOfFile ErrorType = -541478725
)

View File

@@ -164,6 +164,8 @@ func (stream *baseStream) read() (bool, error) {
return true, nil
}
stream.skip = false
// No packets anymore.
return false, nil
}
@@ -178,6 +180,8 @@ func (stream *baseStream) read() (bool, error) {
stream.codecCtx, stream.packet)
if status < 0 {
stream.skip = false
return false, fmt.Errorf(
"%d: couldn't send the packet to the codec context", status)
}
@@ -191,6 +195,8 @@ func (stream *baseStream) read() (bool, error) {
return true, nil
}
stream.skip = false
return false, fmt.Errorf(
"%d: couldn't receive the frame from the codec context", status)
}