You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
rtsp: Move the pollfd setup out of the for loop
This commit is contained in:
@@ -1920,12 +1920,6 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
|
|||||||
struct pollfd *p = rt->p;
|
struct pollfd *p = rt->p;
|
||||||
int *fds = NULL, fdsnum, fdsidx;
|
int *fds = NULL, fdsnum, fdsidx;
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
if (ff_check_interrupt(&s->interrupt_callback))
|
|
||||||
return AVERROR_EXIT;
|
|
||||||
if (wait_end && wait_end - av_gettime_relative() < 0)
|
|
||||||
return AVERROR(EAGAIN);
|
|
||||||
max_p = 0;
|
|
||||||
if (rt->rtsp_hd) {
|
if (rt->rtsp_hd) {
|
||||||
tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
|
tcp_fd = ffurl_get_file_handle(rt->rtsp_hd);
|
||||||
p[max_p].fd = tcp_fd;
|
p[max_p].fd = tcp_fd;
|
||||||
@@ -1953,6 +1947,12 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
|
|||||||
av_free(fds);
|
av_free(fds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
if (ff_check_interrupt(&s->interrupt_callback))
|
||||||
|
return AVERROR_EXIT;
|
||||||
|
if (wait_end && wait_end - av_gettime_relative() < 0)
|
||||||
|
return AVERROR(EAGAIN);
|
||||||
n = poll(p, max_p, POLL_TIMEOUT_MS);
|
n = poll(p, max_p, POLL_TIMEOUT_MS);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
int j = 1 - (tcp_fd == -1);
|
int j = 1 - (tcp_fd == -1);
|
||||||
|
Reference in New Issue
Block a user