[Ffmpeg-devel] HTTP probing issue...

Ryan Martell rdm4
Tue Feb 20 21:28:54 CET 2007


Hi--

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?

Any suggestions?

Thanks,
-Ryan




More information about the ffmpeg-devel mailing list