Message ID | 20170304003054.17741-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Headers | show |
On Sat, 4 Mar 2017, Michael Niedermayer wrote: > The code previously completely discarded frames that had any error in a slice Could you set either AVFrame->flags to AV_FRAME_FLAG_CORRUPT or AVFrame->decode_error_flags to FF_DECODE_ERROR_INVALID_BITSTREAM in case of error on any of the slices? Thanks, Marton > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/proresdec2.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c > index a3a1ebdecb..75fba9d35d 100644 > --- a/libavcodec/proresdec2.c > +++ b/libavcodec/proresdec2.c > @@ -618,10 +618,11 @@ static int decode_picture(AVCodecContext *avctx) > avctx->execute2(avctx, decode_slice_thread, NULL, NULL, ctx->slice_count); > > for (i = 0; i < ctx->slice_count; i++) > - if (ctx->slices[i].ret < 0) > - return ctx->slices[i].ret; > + if (ctx->slices[i].ret >= 0) > + return 0; > > - return 0; > + av_assert0(ctx->slice_count>0); > + return ctx->slices[0].ret; > } > > static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, > -- > 2.11.0 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
On Sat, Mar 04, 2017 at 03:59:50AM +0100, Marton Balint wrote: > > On Sat, 4 Mar 2017, Michael Niedermayer wrote: > > >The code previously completely discarded frames that had any error in a slice > > Could you set either AVFrame->flags to AV_FRAME_FLAG_CORRUPT or > AVFrame->decode_error_flags to FF_DECODE_ERROR_INVALID_BITSTREAM in > case of error on any of the slices? done, applied thx [...]
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index a3a1ebdecb..75fba9d35d 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -618,10 +618,11 @@ static int decode_picture(AVCodecContext *avctx) avctx->execute2(avctx, decode_slice_thread, NULL, NULL, ctx->slice_count); for (i = 0; i < ctx->slice_count; i++) - if (ctx->slices[i].ret < 0) - return ctx->slices[i].ret; + if (ctx->slices[i].ret >= 0) + return 0; - return 0; + av_assert0(ctx->slice_count>0); + return ctx->slices[0].ret; } static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
The code previously completely discarded frames that had any error in a slice Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/proresdec2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)