Commit bbe9fe46 authored by Stefano Sabatini's avatar Stefano Sabatini

lavf/utils: remove loop on AVERROR(EAGAIN) in av_read_frame()

The loop was introduced in 64d340c6, and
was likely breaking non blocking reads as it busy loops.
parent fd63c2ff
...@@ -1409,18 +1409,12 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) ...@@ -1409,18 +1409,12 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
AVStream *st; AVStream *st;
if (!genpts) { if (!genpts) {
while (1) { ret = s->packet_buffer ?
ret = s->packet_buffer ? read_from_packet_buffer(&s->packet_buffer, &s->packet_buffer_end, pkt) :
read_from_packet_buffer(&s->packet_buffer, &s->packet_buffer_end, pkt) : read_frame_internal(s, pkt);
read_frame_internal(s, pkt); if (ret < 0)
if (ret < 0) { return ret;
if (ret == AVERROR(EAGAIN)) goto return_packet;
continue;
else
return ret;
}
goto return_packet;
}
} }
for (;;) { for (;;) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment