move unlock_frames before return in observed_quit mode. before patch: ./ffmpeg -f avfoundation -i ":0" -y out.wav say something to microphone ffplay out.wav will hear some noise, because not get enough samples from devices
after patch: ./ffmpeg -f avfoundation -i ":0" -y out.wav say something to microphone ffplay out.wav will ok. Signed-off-by: Steven Liu <liuq...@kuaishou.com> --- libavdevice/avfoundation.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index bad3760159..ddde640c80 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -1170,11 +1170,9 @@ static int avf_read_packet(AVFormatContext *s, AVPacket *pkt) ctx->current_audio_frame = nil; } else { pkt->data = NULL; - unlock_frames(ctx); if (ctx->observed_quit) { + unlock_frames(ctx); return AVERROR_EOF; - } else { - return AVERROR(EAGAIN); } } -- 2.25.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".