[Ffmpeg-devel] HTTP probing issue...

Klaas-Pieter Vlieg vlieg
Tue Feb 20 21:47:13 CET 2007


Hi 

> From: Ryan Martell [mailto:rdm4 at martellventures.com] 
> Sent: 20 February 2007 21:29
> 
> I have a weird bug, and I'm not exactly sure how to fix it.
> 
> Essentially, I am adding an asx demuxer to ffmpeg, to support 
> asx files (which are used to redirect to mms streams, among 
> other things).  These are essentially an xml file, with video 
> resources to play in order contained inside them.
> 
> To do this, I modified libavformat/utils.c, along the lines 
> of the http redirector.  I know it's not optimal, but it's 
> working within the existing structure.  This worked until I 
> updated to the latest source base yesterday.
> 
> The problem now is that when probing, it needs to open the 
> file and read data.  The probesize is 2048, which is fine.  
> It downloads the entire asx file, which is only 218 bytes.  
> It then hangs, waiting for more data.  I narrowed it down to 
> tcp_read, in libavformat/tcp.c.
> 
> The problem is that the first time, it returns the entire file.   
> Thereafter, when it is called, there is no data to read on 
> the connection (as it's all been sent), so select returns 0.  
> No data will ever be sent, and select is not returning the FD 
> as being set, so it will never trigger the close connection 
> state.  If I curl the same url, it returns a 218 byte file, 
> then quits, so I suspect that the connection is being closed 
> on the remote end (although have not confirmed it).
> 
> I'm also not sure why this has become broken- did the old 
> version of the http.c code use the Content-Length: field to 
> determine the length of the file, and catch EOF at that level?
> 
Try this: add a sleep(1); at line 99 in http.c
Works for me.

Klaas-Pieter Vlieg




More information about the ffmpeg-devel mailing list