|
|
|
@ -584,10 +584,14 @@ void decode_frame(State *state, AVPacket *pkt, int *got_frame, int64_t desired_f |
|
|
|
|
int ret = avcodec_receive_frame(pCodecContext, frame); |
|
|
|
|
if (ret == 0) { |
|
|
|
|
*got_frame = 1; |
|
|
|
|
} else if (ret == AVERROR(EAGAIN)) { |
|
|
|
|
continue; |
|
|
|
|
} else { |
|
|
|
|
LOGE("decode frame fail..."); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (*got_frame) { |
|
|
|
|
if (desired_frame_number == -1 || |
|
|
|
|
(desired_frame_number != -1 && frame->pts >= desired_frame_number)) { |
|
|
|
|
if (pkt->data) { |
|
|
|
@ -596,6 +600,7 @@ void decode_frame(State *state, AVPacket *pkt, int *got_frame, int64_t desired_f |
|
|
|
|
av_init_packet(pkt); |
|
|
|
|
convert_image(state, pCodecContext, frame, pkt, got_frame, width, height); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
*got_frame = 1; |
|
|
|
|