[FFmpeg-devel] [PATCH] Cleanup resolve_destination in sdp.c
Wed Aug 25 15:31:49 CEST 2010
On Wed, 25 Aug 2010, Luca Abeni wrote:
> On 08/25/2010 02:44 PM, Martin Storsj? wrote:
> > Hi,
> > Now that we don't need to get explicitly IPv4 addresses in the SDP
> > generation code, the resolve_destination function can be simplified a bit,
> > as in the attached patch.
> Looks ok if tested... I never liked that for() loop, so I am happy to
> see this patch :)
> > Or perhaps the whole if (ai) branch could be skipped, assuming that
> > getaddrinfo() returns a failure code if nothing was returned?
> If I understand the manpage correctly, if no address can be found
> then a value different from 0 is returned... So, I guess that yes,
> the if() can be eliminated (but please test if this is the case).
Tested this case on OS X and it returns an error code if unable to
resolve. I think we assume the same thing in some other cases, too.
Applied with this change, making this function much smaller and neater.
More information about the ffmpeg-devel