Bug 214852 - multimedia/ffmpeg: fix RTP stream
Summary: multimedia/ffmpeg: fix RTP stream
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-26 14:50 UTC by Kevin Lo
Modified: 2016-11-29 13:50 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (multimedia)
jbeich: merge-quarterly?


Attachments
Fix rtp stream (2.80 KB, patch)
2016-11-26 14:50 UTC, Kevin Lo
no flags Details | Diff
Fix rtp stream (2.84 KB, patch)
2016-11-26 17:22 UTC, Kevin Lo
jbeich: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Lo freebsd_committer freebsd_triage 2016-11-26 14:50:50 UTC
Created attachment 177416 [details]
Fix rtp stream

I followed the ffmpeg streaming guide to stream to RTP:
https://trac.ffmpeg.org/wiki/StreamingGuide#StreamingasimpleRTPaudiostreamfromFFmpeg

I got an error message:
udp_resolve_host: hostname nor servname provided, or not known
rtp://127.0.0.1:1234: Invalid data found when processing input

It appears to relate to getnameinfo() bug.  FreeBSD's socket calls require
the sockaddr struct length to agree with the address family, but Linux doesn't.
This patch fixes failing getnameinfo() calls on FreeBSD.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2016-11-26 16:17:13 UTC
Comment on attachment 177416 [details]
Fix rtp stream

Looks OK except one nit:

> +-            getnameinfo((struct sockaddr*) &addr, sizeof(addr),
> ++            getnameinfo((struct sockaddr*) &addr,
> ++#ifdef __FreeBSD__
> ++                        ((struct sockaddr*) &addr)->sa_len,

sa_len exists on BSDs, OS X, Solaris but in ports/ only FreeBSD and DragonFly are important. Please, convert to #if HAVE_STRUCT_SOCKADDR_SA_LEN similar to libavformat/network.h.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2016-11-26 16:19:04 UTC
Also add "MFH: 2016Q4" to commit message when landing.
Comment 3 Kevin Lo freebsd_committer freebsd_triage 2016-11-26 17:22:45 UTC
Created attachment 177418 [details]
Fix rtp stream

The revised patch convert to #if HAVE_STRUCT_SOCKADDR_SA_LEN as jbiech@ suggested.
Comment 4 Kevin Lo freebsd_committer freebsd_triage 2016-11-26 17:25:14 UTC
(In reply to Jan Beich (mail not working) from comment #1)

Ok, I updated the patch as you suggested, thanks.
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-11-27 13:41:10 UTC
A commit references this bug:

Author: kevlo
Date: Sun Nov 27 13:41:01 UTC 2016
New revision: 427233
URL: https://svnweb.freebsd.org/changeset/ports/427233

Log:
  Fix RTP stream; FreeBSD's socket calls require the sockaddr struct length
  to agree with the address family.

  PR:	214852
  Submitted by:	me
  Approved by:	jbeich
  MFH:	2016Q4

Changes:
  head/multimedia/ffmpeg/Makefile
  head/multimedia/ffmpeg/files/patch-libavformat_rtsp.c
Comment 6 Kevin Lo freebsd_committer freebsd_triage 2016-11-27 13:55:28 UTC
Committed in r427233.
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-11-29 13:50:57 UTC
A commit references this bug:

Author: kevlo
Date: Tue Nov 29 13:50:12 UTC 2016
New revision: 427379
URL: https://svnweb.freebsd.org/changeset/ports/427379

Log:
  MFH: r427233

  Fix RTP stream; FreeBSD's socket calls require the sockaddr struct length
  to agree with the address family.

  PR:	214852
  Submitted by:	me
  Approved by:	jbeich

  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2016Q4/
  branches/2016Q4/multimedia/ffmpeg/Makefile
  branches/2016Q4/multimedia/ffmpeg/files/patch-libavformat_rtsp.c