You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
Move get_arg to avoid future declaration of function when
new code is added. Originally committed as revision 19815 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
64
ffserver.c
64
ffserver.c
@@ -1192,6 +1192,38 @@ static void get_word(char *buf, int buf_size, const char **pp)
|
|||||||
*pp = p;
|
*pp = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void get_arg(char *buf, int buf_size, const char **pp)
|
||||||
|
{
|
||||||
|
const char *p;
|
||||||
|
char *q;
|
||||||
|
int quote;
|
||||||
|
|
||||||
|
p = *pp;
|
||||||
|
while (isspace(*p)) p++;
|
||||||
|
q = buf;
|
||||||
|
quote = 0;
|
||||||
|
if (*p == '\"' || *p == '\'')
|
||||||
|
quote = *p++;
|
||||||
|
for(;;) {
|
||||||
|
if (quote) {
|
||||||
|
if (*p == quote)
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
if (isspace(*p))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (*p == '\0')
|
||||||
|
break;
|
||||||
|
if ((q - buf) < buf_size - 1)
|
||||||
|
*q++ = *p;
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
*q = '\0';
|
||||||
|
if (quote && *p == quote)
|
||||||
|
p++;
|
||||||
|
*pp = p;
|
||||||
|
}
|
||||||
|
|
||||||
static int validate_acl(FFStream *stream, HTTPContext *c)
|
static int validate_acl(FFStream *stream, HTTPContext *c)
|
||||||
{
|
{
|
||||||
enum IPAddressAction last_action = IP_DENY;
|
enum IPAddressAction last_action = IP_DENY;
|
||||||
@@ -3620,38 +3652,6 @@ static void compute_bandwidth(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_arg(char *buf, int buf_size, const char **pp)
|
|
||||||
{
|
|
||||||
const char *p;
|
|
||||||
char *q;
|
|
||||||
int quote;
|
|
||||||
|
|
||||||
p = *pp;
|
|
||||||
while (isspace(*p)) p++;
|
|
||||||
q = buf;
|
|
||||||
quote = 0;
|
|
||||||
if (*p == '\"' || *p == '\'')
|
|
||||||
quote = *p++;
|
|
||||||
for(;;) {
|
|
||||||
if (quote) {
|
|
||||||
if (*p == quote)
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
if (isspace(*p))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (*p == '\0')
|
|
||||||
break;
|
|
||||||
if ((q - buf) < buf_size - 1)
|
|
||||||
*q++ = *p;
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
*q = '\0';
|
|
||||||
if (quote && *p == quote)
|
|
||||||
p++;
|
|
||||||
*pp = p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add a codec and set the default parameters */
|
/* add a codec and set the default parameters */
|
||||||
static void add_codec(FFStream *stream, AVCodecContext *av)
|
static void add_codec(FFStream *stream, AVCodecContext *av)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user