mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-31 02:13:51 +08:00
obs-ffmpeg: Receive packets while frame queue is full
Previously, we always assumed we could push more frames before an encoded packet would be available. Actually, we can get EAGAIN when the frame queue is full and before any encoded packets have been completed. Instead, attempt to read packets more often as the worst that can happen is we get EAGAIN again.
This commit is contained in:
@@ -543,7 +543,7 @@ static bool vaapi_encode(void *data, struct encoder_frame *frame,
|
||||
}
|
||||
|
||||
ret = avcodec_send_frame(enc->context, hwframe);
|
||||
if (ret == 0)
|
||||
if (ret == 0 || ret == AVERROR(EAGAIN))
|
||||
ret = avcodec_receive_packet(enc->context, enc->packet);
|
||||
|
||||
got_packet = (ret == 0);
|
||||
|
||||
Reference in New Issue
Block a user