[FFmpeg-trac] #4473(avformat:new): Can't receive RTP stream on FreeBSD

FFmpeg trac at avcodec.org
Sat Apr 11 16:04:52 CEST 2015


#4473: Can't receive RTP stream on FreeBSD
----------------------------------+---------------------------------------
             Reporter:  aaz       |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avformat  |                  Version:  unspecified
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+---------------------------------------
 I'm trying to transmit a simple point-to-point RTP audio stream on
 FreeBSD.

 Command to send the stream (codec parameters match one of the static RTP
 payload types):
 {{{
 $ ffmpeg -f lavfi -i 'sine=440:4:r=8000' -f rtp -acodec pcm_mulaw -ac 1
 -ar 8000 rtp://127.0.0.1:20000
 }}}

 Command to receive the stream:
 {{{
 $ ffplay -f rtp rtp://127.0.0.1:20000
 }}}

 The send command works. The receive command receives the first packet and
 correctly detects the stream format, but doesn't receive the actual stream
 or even open a UDP socket for it.

 The same thing happens trying to receive through the SDP file printed by
 the send command.

 Logs attached.

 I traced the reason to a failing `getnameinfo()` call. The call has a
 `salen` parameter which is passed `sizeof(struct sockaddr_storage)`, but
 should be passed `sizeof(struct sockaddr_in)` (or whatever the actual
 address struct is). I guess Linux accepts this but FreeBSD doesn't. The
 call returns `EAI_FAIL` ("non-recoverable failure in name resolution").

 Relevant quote from the
 [[http://www.freebsd.org/cgi/man.cgi?query=getnameinfo&sektion=3|FreeBSD
 manpage]]:

   The sockaddr structure //sa// should point to either a sockaddr_in,
   sockaddr_in6 or sockaddr_dl structure (for IPv4, IPv6 or link-layer
   respectively) that is //salen// bytes long.

 And from
 [[http://pubs.opengroup.org/stage7tc1/functions/getnameinfo.html|POSIX]]:

   The //salen// argument contains the length of the address pointed to by
 //sa//.

 Patch that fixes the issue above attached, but there are other similar
 calls to `getnameinfo()`.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4473>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list