Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
c01d1d4d
Commit
c01d1d4d
authored
12 years ago
by
Clément Bœsch
Committed by
Clément Bœsch
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
http: add -content_type user option.
parent
6ddb03ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/http.c
+5
-0
5 additions, 0 deletions
libavformat/http.c
with
5 additions
and
0 deletions
libavformat/http.c
+
5
−
0
View file @
c01d1d4d
...
...
@@ -46,6 +46,7 @@ typedef struct {
int
line_count
;
int
http_code
;
int64_t
chunksize
;
/**< Used if "Transfer-Encoding: chunked" otherwise -1. */
char
*
content_type
;
char
*
user_agent
;
int64_t
off
,
filesize
;
char
location
[
MAX_URL_SIZE
];
...
...
@@ -72,6 +73,7 @@ static const AVOption options[] = {
{
"seekable"
,
"Control seekability of connection"
,
OFFSET
(
seekable
),
AV_OPT_TYPE_INT
,
{.
i64
=
-
1
},
-
1
,
1
,
D
},
{
"chunked_post"
,
"use chunked transfer-encoding for posts"
,
OFFSET
(
chunked_post
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
1
,
E
},
{
"headers"
,
"custom HTTP headers, can override built in default headers"
,
OFFSET
(
headers
),
AV_OPT_TYPE_STRING
,
{
0
},
0
,
0
,
D
|
E
},
{
"content_type"
,
"force a content type"
,
OFFSET
(
content_type
),
AV_OPT_TYPE_STRING
,
{
0
},
0
,
0
,
D
|
E
},
{
"user-agent"
,
"override User-Agent header"
,
OFFSET
(
user_agent
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"multiple_requests"
,
"use persistent connections"
,
OFFSET
(
multiple_requests
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
D
|
E
},
{
"post_data"
,
"custom HTTP post data"
,
OFFSET
(
post_data
),
AV_OPT_TYPE_BINARY
,
.
flags
=
D
|
E
},
...
...
@@ -451,6 +453,9 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
if
(
!
has_header
(
s
->
headers
,
"
\r\n
Content-Length: "
)
&&
s
->
post_data
)
len
+=
av_strlcatf
(
headers
+
len
,
sizeof
(
headers
)
-
len
,
"Content-Length: %d
\r\n
"
,
s
->
post_datalen
);
if
(
!
has_header
(
s
->
headers
,
"
\r\n
Content-Type: "
)
&&
s
->
content_type
)
len
+=
av_strlcatf
(
headers
+
len
,
sizeof
(
headers
)
-
len
,
"Content-Type: %s
\r\n
"
,
s
->
content_type
);
/* now add in custom headers */
if
(
s
->
headers
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment