You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
Fix standalone compilation of pipe protocol.
file_check() is not only used by the file protocol, adjust #ifdef accordingly.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user