diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-05 03:09:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-05 03:30:24 +0200 |
commit | b000b86e1dd03c4ff89cd63a6fa88fc280947c94 (patch) | |
tree | 8ba961dc8c013885d7bdfe944fb7cb31d5dc6d95 /libavformat/file.c | |
parent | 9a5624a0f1b205e966391645a512c6dccdce42cd (diff) | |
parent | af1ca249e8eb685823dd0dade3aa3c1d119a61ec (diff) | |
download | ffmpeg-b000b86e1dd03c4ff89cd63a6fa88fc280947c94.tar.gz |
Merge remote branch 'qatar/master'
* qatar/master: (23 commits)
doc: Check standalone compilation before submitting new components.
Fix standalone compilation of pipe protocol.
Fix standalone compilation of ac3_fixed encoder.
Fix standalone compilation of binkaudio_dct / binkaudio_rdft decoders.
Fix standalone compilation of IMC decoder.
Fix standalone compilation of WTV demuxer.
Fix standalone compilation of MXPEG decoder.
flashsv: K&R cosmetics
matroskaenc: fix memory leak
vc1: make overlap filter for I-frames bit-exact.
vc1dec: use s->start/end_mb_y instead of passing them as function args.
Revert "VC1: merge idct8x8, coeff adjustments and put_pixels."
Replace strncpy() with av_strlcpy().
indeo3: Eliminate use of long.
get_bits: make cache unsigned to eliminate undefined signed overflow.
asfdec: fix assert failure on invalid files
avfilter: check malloc return values.
Not pulled as reason for reindent is not pulled: mpegvideo: reindent.
nutenc: check malloc return values.
Not pulled due to much simpler solution in ffmpeg *: don't av_malloc(0).
...
Conflicts:
doc/developer.texi
libavcodec/Makefile
libavcodec/get_bits.h
libavcodec/mpegvideo.c
libavformat/Makefile
libavutil/log.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/file.c')
-rw-r--r-- | libavformat/file.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libavformat/file.c b/libavformat/file.c index fc8d174119..a9c5281102 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -51,6 +51,19 @@ static int file_get_handle(URLContext *h) return (intptr_t) h->priv_data; } +static int file_check(URLContext *h, int mask) +{ + struct stat st; + int ret = stat(h->filename, &st); + if (ret < 0) + return AVERROR(errno); + + ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0; + ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0; + + return ret; +} + #if CONFIG_FILE_PROTOCOL static int file_open(URLContext *h, const char *filename, int flags) @@ -95,19 +108,6 @@ static int file_close(URLContext *h) return close(fd); } -static int file_check(URLContext *h, int mask) -{ - struct stat st; - int ret = stat(h->filename, &st); - if (ret < 0) - return AVERROR(errno); - - ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0; - ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0; - - return ret; -} - URLProtocol ff_file_protocol = { .name = "file", .url_open = file_open, |