summaryrefslogtreecommitdiffstats
path: root/stream/stream_lavf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream_lavf.c')
-rw-r--r--stream/stream_lavf.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/stream/stream_lavf.c b/stream/stream_lavf.c
index a161c19cf9..645fcb5c6c 100644
--- a/stream/stream_lavf.c
+++ b/stream/stream_lavf.c
@@ -131,6 +131,7 @@ static const char * const prefix[] = { "lavf://", "ffmpeg://" };
static int open_f(stream_t *stream, int mode)
{
+ struct MPOpts *opts = stream->opts;
int flags = 0;
AVIOContext *avio = NULL;
int res = STREAM_ERROR;
@@ -179,22 +180,24 @@ static int open_f(stream_t *stream, int mode)
}
// HTTP specific options (other protocols ignore them)
- if (network_useragent)
- av_dict_set(&dict, "user-agent", network_useragent, 0);
- if (network_cookies_enabled)
- av_dict_set(&dict, "cookies", talloc_steal(temp, cookies_lavf(stream->log)), 0);
- av_dict_set(&dict, "tls_verify", network_tls_verify ? "1" : "0", 0);
- if (network_tls_ca_file)
- av_dict_set(&dict, "ca_file", network_tls_ca_file, 0);
+ if (opts->network_useragent)
+ av_dict_set(&dict, "user-agent", opts->network_useragent, 0);
+ if (opts->network_cookies_enabled) {
+ char *file = opts->network_cookies_file;
+ av_dict_set(&dict, "cookies", cookies_lavf(temp, stream->log, file), 0);
+ }
+ av_dict_set(&dict, "tls_verify", opts->network_tls_verify ? "1" : "0", 0);
+ if (opts->network_tls_ca_file)
+ av_dict_set(&dict, "ca_file", opts->network_tls_ca_file, 0);
char *cust_headers = talloc_strdup(temp, "");
- if (network_referrer) {
+ if (opts->network_referrer) {
cust_headers = talloc_asprintf_append(cust_headers, "Referer: %s\r\n",
- network_referrer);
+ opts->network_referrer);
}
- if (network_http_header_fields) {
- for (int n = 0; network_http_header_fields[n]; n++) {
+ if (opts->network_http_header_fields) {
+ for (int n = 0; opts->network_http_header_fields[n]; n++) {
cust_headers = talloc_asprintf_append(cust_headers, "%s\r\n",
- network_http_header_fields[n]);
+ opts->network_http_header_fields[n]);
}
}
if (strlen(cust_headers))