[MPlayer-users] mms streaming code question

Andrew Eberbach bvrc at hotmail.com
Fri Dec 19 18:42:22 CET 2008


Hi,

I'm trying to figure out why I'm experiencing some weird behaviour with mms streaming on XBMC. Now before I get flamed and told that it's an XBMC problem, just hear me out. I'm perfectly willing to accept that it could be but I figure the people reading this list understand streaming protocols much better than I do so I'm just covering my bases and the code in question is the same in XBMC and in the MPlayer svn.

If you look at stream/asf_mmst_streaming.c

There's a bit there called get_data in which there's a call to recv while trying to fill up the buffer. 

len = recv (s, &buf[total], count-total, 0);

    if (len<=0) {
      perror ("read error:");
      return 0;
    }

Now, this happens during the call to 

    if (!get_data (s, data, packet_len)) {
      mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_MMST_MediaDataReadFailed);
      return 0;
    }

in get_media_packet. What I'm seing is that it hits the perror. Now, from recv documentation at (http://www.opengroup.org/onlinepubs/009695399/functions/recv.html) I gather that recv can return:

"Upon successful completion, recv() shall return the length of the message in bytes. If no messages are available to be
received and the peer has performed an orderly shutdown, recv() shall return 0. Otherwise, -1 shall be returned and
errno set to indicate the error."

Now I understand I'm going to have to recompile this badboy and print out the errno to get more information, but I'm wondering, if the return isn't a negative number and is 0, does this mean that the server on the other end just closed the connection? Has anyone seen similar behaviour with mms streaming?

Thanks,
Andrew

_________________________________________________________________
Life on your PC is safer, easier, and more enjoyable with Windows Vista®. 
http://clk.atdmt.com/MRT/go/127032870/direct/01/


More information about the MPlayer-users mailing list