-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
747 additions
and
30,627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/multimedia/ffmpeg/patches/ffmpeg-2.8-Resolve-plex-direct-domains.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
commit eb2a7e1eb920cd9e44223607978344cf4b95d990 | ||
Author: Jonas Karlman <jonas@kwiboo.se> | ||
Date: Tue Jun 16 02:47:28 2015 +0200 | ||
|
||
Resolve .plex.direct domains | ||
|
||
diff --git a/libavformat/tcp.c b/libavformat/tcp.c | ||
index 3c3f4f5..e543c06 100644 | ||
--- a/libavformat/tcp.c | ||
+++ b/libavformat/tcp.c | ||
@@ -67,6 +67,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags) | ||
int ret; | ||
char hostname[1024],proto[1024],path[1024]; | ||
char portstr[10]; | ||
+ size_t len; | ||
+ char *c; | ||
s->open_timeout = 5000000; | ||
|
||
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), | ||
@@ -102,6 +104,17 @@ static int tcp_open(URLContext *h, const char *uri, int flags) | ||
snprintf(portstr, sizeof(portstr), "%d", port); | ||
if (s->listen) | ||
hints.ai_flags |= AI_PASSIVE; | ||
+ len = strlen(hostname); | ||
+ if (len > 12 && !strcmp(hostname + len - 12, ".plex.direct")) { | ||
+ for (c = hostname; *c; c++) { | ||
+ if (*c == '-') { | ||
+ *c = '.'; | ||
+ } else if (*c == '.') { | ||
+ *c = '\0'; | ||
+ break; | ||
+ } | ||
+ } | ||
+ } | ||
if (!hostname[0]) | ||
ret = getaddrinfo(NULL, portstr, &hints, &ai); | ||
else |
Oops, something went wrong.