Proper dav1d decoding and flushing
This commit is contained in:
parent
ace16a6b6a
commit
86a790167d
|
@ -94,16 +94,13 @@ func (d *Decoder) Properties() frame.StreamProperties {
|
|||
|
||||
func (d *Decoder) decodeFrame() C.int {
|
||||
var res C.int
|
||||
if res = C.dav1d_send_data(d.ctx, &d.data); res < 0 {
|
||||
if res != -ErrEAGAIN {
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
if res = d.flushPicture(); res < 0 {
|
||||
if res != -ErrEAGAIN {
|
||||
return res
|
||||
}
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
|
||||
if d.data.sz == 0 {
|
||||
|
@ -115,6 +112,19 @@ func (d *Decoder) decodeFrame() C.int {
|
|||
}
|
||||
}
|
||||
res = -1
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
if res = C.dav1d_send_data(d.ctx, &d.data); res < 0 {
|
||||
if res != -ErrEAGAIN {
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
if res = d.flushPicture(); res < 0 {
|
||||
if res != -ErrEAGAIN {
|
||||
return res
|
||||
}
|
||||
}
|
||||
return res
|
||||
|
|
Loading…
Reference in a new issue