#5774 closed defect (fixed)

Streaming from multicast on tvOS fails (Apple TV)

Reported by: David2X Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: udp sdp osx
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Following command FAILS on tvOS (but exactly same code works on iOS):

avformat_open_input(&pFormatCtx, sdpString, NULL, &opts)

where sdpString is

"data:text/plain;charset=utf-8,v=0\r\no=- 0 0 IN IP4 235.255.255.245\r\nc=IN IP4 235.255.255.245\r\nm=video 8008 RTP/AVP 26\r\na=source-filter: incl IN IP4 235.255.255.245 192.168.68.94\r\no=- 0 0 IN IP4 235.255.255.245\r\nc=IN IP4 235.255.255.245\r\nm=audio 8006 RTP/AVP 0\r\na=source-filter: incl IN IP4 235.255.255.245 192.168.68.94"

From log

[data @ 0x128351300] No default whitelist set
[data @ 0x128351300] Content-type: text/plain
[data @ 0x128351300] Ignoring option 'charset=utf-8'
[sdp @ 0x102089800] Format sdp probed with size=2048 and score=50
[rtp @ 0x128351df0] No default whitelist set
[udp @ 0x1283520b0] No default whitelist set
setsockopt(MCAST_JOIN_SOURCE_GROUP): Can't assign requested address

How to reproduce:

- Compile FFMPEG for tvOS using this build script: 
https://github.com/kewlbear/FFmpeg-iOS-build-script/blob/master/build-ffmpeg-tvos.sh

- Link with tvOS project

- Run following commands on Apple TV
	avcodec_register_all();
	av_register_all();
	avformat_network_init();
	AVDictionary *opts = 0;
	pFormatCtx = avformat_alloc_context();
	avformat_open_input(&pFormatCtx, sdpString , NULL, &opts) 

Attachments (2)

patchudptv.diff (719 bytes) - added by cehoyos 17 months ago.
patchudptv2.diff (893 bytes) - added by cehoyos 17 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 17 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords upd sdp osx added

Does it work if you replace line 281 of libavformat/udp.c with #if 0?
Is this supposed to work on tvOS?

comment:2 Changed 17 months ago by cehoyos

  • Keywords udp added; upd removed

comment:3 Changed 17 months ago by David2X

With replaced line it works as expected.

Changed 17 months ago by cehoyos

comment:4 Changed 17 months ago by cehoyos

Please also test attached possible real fix.

comment:5 Changed 17 months ago by David2X

That did not work. But I think only thing needed is to include TargetConditionals?.h

http://stackoverflow.com/questions/6802903/c-ifdef-mac-os-x-question

Changed 17 months ago by cehoyos

comment:6 Changed 17 months ago by cehoyos

New variant attached, please test.

comment:7 Changed 17 months ago by David2X

Last patch is working.

comment:8 Changed 17 months ago by cehoyos

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.