mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-11-01 04:53:04 +08:00 
			
		
		
		
	avcodec/decode: check the output frame for discard samples with all decoders
And not just those with the old decode() API. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
		| @@ -597,6 +597,14 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) | ||||
|     if (codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME) { | ||||
|         ret = codec->cb.receive_frame(avctx, frame); | ||||
|         emms_c(); | ||||
|         if (!ret) { | ||||
|             if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) | ||||
|                 ret = (frame->flags & AV_FRAME_FLAG_DISCARD) ? AVERROR(EAGAIN) : 0; | ||||
|             else if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) { | ||||
|                 int64_t discarded_samples = 0; | ||||
|                 ret = discard_samples(avctx, frame, &discarded_samples); | ||||
|             } | ||||
|         } | ||||
|     } else | ||||
|         ret = decode_simple_receive_frame(avctx, frame); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 James Almer
					James Almer