Message ID | C8C315C8-3343-4300-8ED3-482372097A58@gavrushkin.com |
---|---|
State | New |
Headers | show |
On Wed, Jan 03, 2018 at 12:54:03PM +0300, sergey@gavrushkin.com wrote: > > The error code returned by decode_extradata_ps() is inconsistent after this > > its not "if any failed" it is returning an error if the last failed > > Sorry, I don't get how it is supposed to work. I just found the previous implementation and checked which commit broke it. if a loop running multiple iterations each decoding a "packet" then a failure of packet n should be treated the same as a failure of packet n+1 The code after the patch would return failure if the last packet fails but not if a earlier packet fails Note this is seperate from continuing to decode all packets. the code can continue after an error but still declare an error at the end or it could never decalare an error. Either way it should not treat the last iteration special [...]
diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c index fee28d9..403fd39 100644 --- a/libavcodec/h264_parse.c +++ b/libavcodec/h264_parse.c @@ -487,7 +487,7 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps, } else { *is_avc = 0; ret = decode_extradata_ps(data, size, ps, 0, logctx); - if (ret < 0) + if (ret < 0 && (err_recognition & AV_EF_EXPLODE)) return ret; } return size;