#3024 closed defect (fixed)
ffplay do not keep custom http headers across http sessions playing m3u8
Reported by: | Kow | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | hls |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
FFmpeg version:
ffmpeg version N-56778-gcd1b22d
Summary of the bug:
Attempting to use ffplay to play a remote m3u8 stream the http custom headers are used one time just to download the m3u8 mainfest.
Next, when downloading the hls chunks the http custom headers are lost.
The user-agent, instead, is kept across all the http sessions.
How to reproduce:
ffplay -user-agent 'Linux' -headers $'X-Forwarded-For: 185.186.145.47\r\n' http://rm-edge-4.cdn2.streamago.tv/streamagoedge/1922/815/playlist.m3u8
Attachments (2)
Change History (7)
by , 11 years ago
comment:1 by , 11 years ago
Summary: | ffplay do not keep custom http headers within http sessions playing m3u8 → ffplay do not keep custom http headers across http sessions playing m3u8 |
---|
comment:2 by , 11 years ago
Component: | FFplay → undetermined |
---|---|
Keywords: | hls added |
Priority: | important → normal |
Resolution: | → duplicate |
Status: | new → closed |
Version: | unspecified → git-master |
Looks like a duplicate of ticket #1291, please test again once it is fixed.
comment:3 by , 11 years ago
It is similar but not exactly the same. The user-agent is correcty kept across all the http sessions (getting the initial manifest and the following chunk download) but not the the -header content.
I understand nothing about C programming but it seems that the hls.c looking about info to broker thru the whole bunch of sessions takes care of the user-agent and cookies only, if I'm not wrong.
I've fixed for myself by hardcoding into http.c my header:
static int http_connect(URLContext *h, const char *path, const char *local_path,
const char *hoststr, const char *auth,
const char *proxyauth, int *new_location)
{
HTTPContext *s = h->priv_data;
int post, err;
char headers[4096] = "X-Forwarded-For: xxx.186.xxx.xxx\r\n";
char *authstr = NULL, *proxyauthstr = NULL;
int64_t off = s->off;
int len = 0;
const char *method;
but I know it it just a specific workaround to fit my needs.
Tanks for your attention.
by , 11 years ago
hls.c patched to keep user header during the whole hls streaming
comment:4 by , 11 years ago
We have patched hls.c to solve the user header lost during http connections.
It works fine for me now.
comment:5 by , 11 years ago
Component: | undetermined → avformat |
---|---|
Resolution: | duplicate → fixed |
Fixed by you in 4684539c - thank you!
Log summary showing only the first http request using a custom header