UDP sending not checked.

About encoding, codec settings, muxers and filter usage
Frederic F
New Cone
New Cone
Posts: 5
Joined: 09 Nov 2004 13:19

UDP sending not checked.

Postby Frederic F » 09 Nov 2004 14:26

While making some streaming tests on a linux (SuSe) PC over an Ethernet LAN, I observed that a lot of packets were lost. But after using tcpdump, I managed to see that, while indeed some packets were lost during transmission, other packets were not even sent !

Looking at the code (specifically modules/access_output/udp.c), I could see that this line (line 524 in version 0.8.0-test2):

Code: Select all

send( p_thread->i_handle, p_pk->p_buffer, p_pk->i_buffer, 0 );
was not checked against possible errors.

Then I replaced the previous line with this block of code:

Code: Select all

{ #define NBTRYMAX 10 int nbsent=-1; int nbtry=0; while (nbsent==-1 && nbtry++ < NBTRYMAX) { nbsent = send( p_thread->i_handle, p_pk->p_buffer, p_pk->i_buffer, 0 ); } if (nbtry > 1) { if (nbsent==-1) { msg_Dbg( p_thread, "Error : One packet could not be sent after %d attempts.", NBTRYMAX); } else { msg_Dbg( p_thread, "Warning : packet sent after %d attempts", nbtry); } } }
which tries several times to send the packet before giving up.

Frederic F
New Cone
New Cone
Posts: 5
Joined: 09 Nov 2004 13:19

Postby Frederic F » 10 Nov 2004 11:25

I filed it in bugzilla, bug-id 1918

fen

Postby fen » 16 Nov 2004 17:44

Well it seems to be a bit weird. We open the socket in blocking mode, so
send should block until it can send the packet.

Could you report the value of errno in case of failure as well as strerror(errno) ?

Frederic F
New Cone
New Cone
Posts: 5
Joined: 09 Nov 2004 13:19

Postby Frederic F » 17 Nov 2004 20:49

Perhaps it is specific to SuSe ? Or even to the PC used in the test ? I really don't know. I also tried on WindowsXP (on a different PC) and the problem did not occur there.

errno is set to 111 (ECONNREFUSED "Connection refused").


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 13 guests