mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:21:11 +01:00
fixup! lavc/rkmppdec: refactor RKMPP decoders and extend codecs
refine return value handling. Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
parent
419ef5955d
commit
0983084625
1 changed files with 9 additions and 3 deletions
|
|
@ -783,10 +783,16 @@ static int rkmpp_get_frame(AVCodecContext *avctx, AVFrame *frame, int timeout)
|
||||||
else
|
else
|
||||||
ret = r->mapi->decode_get_frame(r->mctx, &mpp_frame);
|
ret = r->mapi->decode_get_frame(r->mctx, &mpp_frame);
|
||||||
|
|
||||||
if (ret != MPP_OK && ret != MPP_ERR_TIMEOUT) {
|
if (ret != MPP_OK) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Failed to get frame: %d\n", ret);
|
if (timeout == MPP_TIMEOUT_NON_BLOCK) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Failed to get frame (non-block): %d\n", ret);
|
||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
if (timeout != MPP_TIMEOUT_NON_BLOCK && ret != MPP_NOK && ret != MPP_ERR_TIMEOUT) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Failed to get frame (timeout: %d): %d\n", timeout, ret);
|
||||||
|
return AVERROR_EXTERNAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!mpp_frame) {
|
if (!mpp_frame) {
|
||||||
if (timeout != MPP_TIMEOUT_NON_BLOCK)
|
if (timeout != MPP_TIMEOUT_NON_BLOCK)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue