diff --git a/avutil/error.go b/avutil/error.go index 76f0cff0..7b56355b 100644 --- a/avutil/error.go +++ b/avutil/error.go @@ -16,7 +16,7 @@ import "errors" const ( AvErrorEOF = -('E' | ('O' << 8) | ('F' << 16) | (' ' << 24)) - AvErrorEAGAIN = -35 + AvErrorEAGAIN = -11 ) func ErrorFromCode(code int) error { diff --git a/example/tutorial01.go b/example/tutorial01.go index 7e3d0417..dd7565dc 100644 --- a/example/tutorial01.go +++ b/example/tutorial01.go @@ -155,8 +155,10 @@ func main() { } for response >= 0 { response = pCodecCtx.AvcodecReceiveFrame((*avcodec.Frame)(unsafe.Pointer(pFrame))) - if response == avutil.AvErrorEAGAIN || response == avutil.AvErrorEOF { + if response == avutil.AvErrorEOF { break + } else if response == avutil.AvErrorEAGAIN { + continue } else if response < 0 { fmt.Printf("Error while receiving a frame from the decoder: %s\n", avutil.ErrorFromCode(response)) return