[FFmpeg-devel] [PATCH 1/4] TCP: factor the poll() call

Ronald S. Bultje rsbultje
Wed Feb 2 19:26:53 CET 2011


Hi,

2011/2/2 M?ns Rullg?rd <mans at mansr.com>:
> Nicolas George <nicolas.george at normalesup.org> writes:
>
>> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
>> ---
>> ?libavformat/tcp.c | ? 28 ++++++++++++++++++----------
>> ?1 files changed, 18 insertions(+), 10 deletions(-)
>>
>> diff --git a/libavformat/tcp.c b/libavformat/tcp.c
>> index ac4e4b0..564d69f 100644
>> --- a/libavformat/tcp.c
>> +++ b/libavformat/tcp.c
>> @@ -129,17 +129,26 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
>> ? ? ?return ret;
>> ?}
>>
>> +static int tcp_wait_fd(int fd, int write)
>> +{
>> + ? ?int ev = write ? POLLOUT : POLLIN;
>
> Is there a reason you don't let the caller simply pass POLLIN or
> POLLOUT directly?

It's inlined (gcc always inlines everything), so it doesn't matter,
code generated is identical.

Ronald



More information about the ffmpeg-devel mailing list