| 796 | } |
| 797 | |
| 798 | int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame, unsigned flags) |
| 799 | { |
| 800 | AVCodecInternal *avci = avctx->internal; |
| 801 | int ret; |
| 802 | |
| 803 | if (avci->buffer_frame->buf[0]) { |
| 804 | av_frame_move_ref(frame, avci->buffer_frame); |
| 805 | } else { |
| 806 | ret = decode_receive_frame_internal(avctx, frame, flags); |
| 807 | if (ret < 0) |
| 808 | return ret; |
| 809 | } |
| 810 | |
| 811 | ret = frame_validate(avctx, frame); |
| 812 | if (ret < 0) |
| 813 | goto fail; |
| 814 | |
| 815 | if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { |
| 816 | ret = apply_cropping(avctx, frame); |
| 817 | if (ret < 0) |
| 818 | goto fail; |
| 819 | } |
| 820 | |
| 821 | avctx->frame_num++; |
| 822 | |
| 823 | return 0; |
| 824 | fail: |
| 825 | av_frame_unref(frame); |
| 826 | return ret; |
| 827 | } |
| 828 | |
| 829 | static void get_subtitle_defaults(AVSubtitle *sub) |
| 830 | { |
no test coverage detected