mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
avcodec/lcevcdec: move lcevc_flush_pictures() before lcevc_send_frame()
This commit is contained in:
1 parent
9e80af4e59
commit
902df73ba8
1 file changed
+25
-25
+25
-25
@@ -145,6 +145,31 @@ static int alloc_enhanced_frame(FFLCEVCFrame *frame_ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lcevc_flush_pictures(FFLCEVCContext *lcevc)
|
||||
{
|
||||
LCEVC_PictureHandle picture;
|
||||
LCEVC_ReturnCode res;
|
||||
|
||||
while (1) {
|
||||
AVFrame *base = NULL;
|
||||
res = LCEVC_ReceiveDecoderBase (lcevc->decoder, &picture);
|
||||
if (res != LCEVC_Success && res != LCEVC_Again)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
if (res == LCEVC_Again)
|
||||
break;
|
||||
|
||||
LCEVC_GetPictureUserData(lcevc->decoder, picture, (void **)&base);
|
||||
av_frame_free(&base);
|
||||
|
||||
res = LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lcevc_send_frame(FFLCEVCFrame *frame_ctx, const AVFrame *in)
|
||||
{
|
||||
FFLCEVCContext *lcevc = frame_ctx->lcevc;
|
||||
@@ -270,31 +295,6 @@ static int generate_output(FFLCEVCFrame *frame_ctx, AVFrame *out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lcevc_flush_pictures(FFLCEVCContext *lcevc)
|
||||
{
|
||||
LCEVC_PictureHandle picture;
|
||||
LCEVC_ReturnCode res;
|
||||
|
||||
while (1) {
|
||||
AVFrame *base = NULL;
|
||||
res = LCEVC_ReceiveDecoderBase (lcevc->decoder, &picture);
|
||||
if (res != LCEVC_Success && res != LCEVC_Again)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
if (res == LCEVC_Again)
|
||||
break;
|
||||
|
||||
LCEVC_GetPictureUserData(lcevc->decoder, picture, (void **)&base);
|
||||
av_frame_free(&base);
|
||||
|
||||
res = LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lcevc_receive_frame(FFLCEVCFrame *frame_ctx, AVFrame *out)
|
||||
{
|
||||
FFLCEVCContext *lcevc = frame_ctx->lcevc;
|
||||
|
||||
Reference in new issue
Block a user