Web lists-archives.com

[MPlayer-dev-eng] [PATCH]Allow longer url in demux_lavf.c

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
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,
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);
MPlayer-dev-eng mailing list