Opened 8 years ago

Closed 8 years ago

#5774 closed defect (fixed)

Streaming from multicast on tvOS fails (Apple TV)

Reported by: Dave 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 Carl Eugen Hoyos 8 years ago.
patchudptv2.diff (893 bytes ) - added by Carl Eugen Hoyos 8 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Carl Eugen Hoyos, 8 years ago

Component: undeterminedavformat
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 by Carl Eugen Hoyos, 8 years ago

Keywords: udp added; upd removed

comment:3 by Dave, 8 years ago

With replaced line it works as expected.

by Carl Eugen Hoyos, 8 years ago

Attachment: patchudptv.diff added

comment:4 by Carl Eugen Hoyos, 8 years ago

Please also test attached possible real fix.

comment:5 by Dave, 8 years ago

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

by Carl Eugen Hoyos, 8 years ago

Attachment: patchudptv2.diff added

comment:6 by Carl Eugen Hoyos, 8 years ago

New variant attached, please test.

comment:7 by Dave, 8 years ago

Last patch is working.

comment:8 by Carl Eugen Hoyos, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.