[PATCH]Allow longer url in demux_lavf.c
"Lu, Ran" <[email protected]>
| Newsgroups | gmane.comp.video.mplayer.devel |
|---|---|
| Message-ID | <97592621.2ZSZQcjao9@rmbp> |
Hi all, I noticed when playing some live stream from twitch mplayer cannot update the m3u8 playlist. The reason is the size of the mp_filename array is only 256 byte, so url like "http://video-edge-2aa234.iad02.hls.ttvnw.net/hls-835268/luzbelheim_21377489200_454740786/chunked/index-live.m3u8?token=id=7800187502285523477,bid=21377489200,exp=1463625667,node=video-edge-2aa234-1.iad02.hls.justin.tv,nname=video-edge-2aa234.iad02,fmt=chunked&sig=b511bc935cde4806c9412b53b1bc5c7c24eb416d" is truncated and the demuxer reports a "403 forbidden" error because the auth code is incomplete. The patch in the attachment simply increase the size of mp_filename to 2048. I pick this to match the size used in ffmpeg url. With this patch mplayer can play the stream without the help of other programs like livestream. But it is still imperfect. I think mplayer apply the cache mechanism to the initial m3u8 playlist instead of the real stream. As the result the cache is always 0%, and every time the stream move to a new ts chunk or update the m3u8 playlist there is a slight but noticeable pause, and mplayer drop 3-4 frames depends on the speed of the internet. I had a quick look at the source code but did not find a place I can wire the ffmpeg stream to mplayer cache. Any suggestions? -- Best Regards, LR _______________________________________________ MPlayer-dev-eng mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
mp_filename.patch
(text/x-patch, 424 B)
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index eadb8aa..52f4681 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -530,7 +530,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
AVDictionaryEntry *t = NULL;
lavf_priv_t *priv= demuxer->priv;
int i;
- char mp_filename[256]="mp:";
+ char mp_filename[2048]="mp:";
stream_seek(demuxer->stream, 0);