summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRockchip2013-05-22 15:49:29 +0800
committerRockchip2013-05-22 15:49:29 +0800
commitd397f5f69760290956847c16490192799750a83a (patch)
tree0817c01f6b5bba7343bf81ae4e45c8d978d7aa59
parent5b59697d57d952d45e149b0d91b3017dbdaf9e73 (diff)
add patch for android 4.2 multi-user mode
-rw-r--r--libavformat/file.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/file.c b/libavformat/file.c
index 209957b..4d2f84a 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -102,7 +102,7 @@ static int file_open(URLContext *h, const char *filename, int flags)
{
FileContext *c = h->priv_data;
int access;
- int fd;
+ int fd = -1;
struct stat st;
av_strstart(filename, "file:", &filename);
@@ -121,7 +121,12 @@ static int file_open(URLContext *h, const char *filename, int flags)
#ifdef O_BINARY
access |= O_BINARY;
#endif
+ if(!strstr(filename,"fd::")){
fd = open(filename, access, 0666);
+ }else{
+ char *p = strstr(filename, "fd::");
+ fd = dup(atoi(p + 4));
+ }
if (fd == -1)
return AVERROR(errno);
c->fd = fd;