Test environment:
Darwin liuqi05.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 
PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
Big Sur 11.4 (20F71)
before patch:
./ffmpeg -f avfoundation -i ":0" -y out.wav
say something to microphone
ffplay out.wav will get noise.
look the into the code, it will return EAGAIN when
transport control observation is not ctx->observed_quit.

after patch:
./ffmpeg -f avfoundation -i ":0" -y out.wav
say something to microphone
ffplay out.wav will ok.

Signed-off-by: Steven Liu <l...@chinaffmpeg.org>
---
 libavdevice/avfoundation.m | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 0cd6e646d5..cd30f48cfe 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -1186,8 +1186,6 @@ static int avf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
             unlock_frames(ctx);
             if (ctx->observed_quit) {
                 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".

Reply via email to