1 | #ifndef ARD_H |
---|
2 | #define ARD_H |
---|
3 | |
---|
4 | char* ard(char* link) |
---|
5 | { |
---|
6 | debug(99, "link %s", link); |
---|
7 | char* ip = NULL, *pos = NULL, *path = NULL, *streamurl = NULL, *tmpstr = NULL; |
---|
8 | |
---|
9 | ip = string_replace("http://", "", (char*)link, 0); |
---|
10 | |
---|
11 | if(ip != NULL) |
---|
12 | pos = strchr(ip, '/'); |
---|
13 | if(pos != NULL) |
---|
14 | { |
---|
15 | pos[0] = '\0'; |
---|
16 | path = pos + 1; |
---|
17 | } |
---|
18 | |
---|
19 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
20 | if(getconfigint("debuglevel", NULL) == 99) |
---|
21 | writesys("/tmp/ard1_tmpstr", tmpstr, 0); |
---|
22 | |
---|
23 | if(tmpstr != NULL) |
---|
24 | { |
---|
25 | /* |
---|
26 | streamurl = string_resub("'file': '","',",tmpstr,0); |
---|
27 | |
---|
28 | mediaCollection.addMediaStream(0, 0, "", "http://http-stream.rbb-online.de/rbb/abendschau/abendschau_20130923_wahl_s_16_9_256x144.mp4", "akamai"); |
---|
29 | mediaCollection.addMediaStream(0, 1, "rtmp://ondemand.rbb-online.de/ondemand/", "mp4:rbb/abendschau/abendschau_20130923_wahl_m_16_9_512x288.mp4", "akamai"); |
---|
30 | mediaCollection.addMediaStream(1, 0, "", "http://http-stream.rbb-online.de/rbb/abendschau/abendschau_20130923_wahl_s_16_9_256x144.mp4", "akamai"); |
---|
31 | mediaCollection.addMediaStream(1, 1, "", "http://http-stream.rbb-online.de/rbb/abendschau/abendschau_20130923_wahl_m_16_9_512x288.mp4", "akamai"); |
---|
32 | |
---|
33 | */ |
---|
34 | |
---|
35 | streamurl = oregex(".*mediaCollection.addMediaStream.*(http://.*.mp4).*", tmpstr); |
---|
36 | } |
---|
37 | |
---|
38 | free(tmpstr); tmpstr = NULL; |
---|
39 | free(ip), ip = NULL; |
---|
40 | |
---|
41 | if(getconfigint("debuglevel", NULL) == 99) |
---|
42 | writesys("/tmp/ard2_streamurl", streamurl, 0); |
---|
43 | |
---|
44 | // segfault munmap_chunk(): invalid pointer |
---|
45 | // free(pos), pos = NULL; |
---|
46 | // free(path), path = NULL; |
---|
47 | |
---|
48 | debug(99, "streamurl: %s", streamurl); |
---|
49 | return streamurl; |
---|
50 | } |
---|
51 | |
---|
52 | #endif |
---|