Skip to content
Permalink
Browse files

cuvid: Always check for internal errors using parsing

The cuvid parser is basically undocumented, and although you'd
think that a failed callback would result in the overall parse
call returning an error, that is not true.

So, we end up silently trying to keep going as if nothing is wrong,
which doesn't achieve anything.

Solution: check the internal error flag every time.
  • Loading branch information
philipl committed Sep 10, 2016
1 parent 7c5fed1 commit d5fff73d104b19eabc4c4f3654c8430f28875ee8
Showing with 7 additions and 2 deletions.
  1. +7 −2 libavcodec/cuvid.c
@@ -272,8 +272,13 @@ static int cuvid_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_packet_unref(&filtered_packet);

if (ret < 0) {
if (ctx->internal_error)
ret = ctx->internal_error;
goto error;
}

// cuvidParseVideoData doesn't return an error just because stuff failed...
if (ctx->internal_error) {
av_log(avctx, AV_LOG_ERROR, "cuvid decode callback error\n");
ret = ctx->internal_error;
goto error;
}

0 comments on commit d5fff73

Please sign in to comment.