Page 1 of 1

VLC 1.0.5 Defect

Posted: 10 Feb 2010 22:46
by SeanJanis
While testing a PC-to-Network Switch-to-PC VLC setup, I found a crash issue with libstream_out_rtp_plugin.dll. If a video stream is not playing on PC 1 and PC 2 requests an SDP stream from PC 1, then PC 1's VLC instance will crash.

Here are my system settings:
- Windows XP
- VLC Media Player 1.0.5 Goldeneye

Reproducible steps:
- Hook both PC 1 and PC 2 into Network Switch.
- Assign PC 1 an IP Address of 172.16.11.5
- Assign PC 2 an IP Address of 172.16.11.6
- Run VLC on PC 1. File Menu > Media > Streaming...
- Click the Network Tab and select RTP, Address: 127.0.0.1 and Port: 5008 (Any IP Combo will do, we don't care about input stream now)
- Click the Stream Button to bring up the Stream output Screen
- Click the Next button and paste the following string into the "Generated stream output string" text field:

:sout=#transcode{vcodec=mp4v,vb=800,scale=1,acodec=none}
:duplicate{dst=rtp{dst=172.16.11.5,ttl=127,sdp=rtsp://172.16.11.5:554/test.sdp}}


- PC 1 is all set. Now, on PC 2 run your VLC Instance
- File Menu > Open Network Stream...
- Click the Network Tab and select RTSP, 172.16.11.5:554/test.sdp
- Click the Play button and watch the VLC Instance on PC 1 crash because PC 1 cannot send the video stream.

Does anyone else see the same issue?

Re: VLC 1.0.5 Defect

Posted: 11 Feb 2010 16:18
by SeanJanis
Just a follow-up:

You don't necessarily need two PCs. This issue can also be reproduced by using the localhost address (127.0.0.1) and running two VLC instances on the same machine.

Re: VLC 1.0.5 Defect

Posted: 15 Feb 2010 15:06
by SeanJanis
Has anyone been able to reproduce this issue / find a solution? Thank you, I appreciate it.

Re: VLC 1.0.5 Defect

Posted: 15 Feb 2010 17:21
by Rémi Denis-Courmont
It works fine here.

Re: VLC 1.0.5 Defect

Posted: 15 Feb 2010 20:13
by SeanJanis
Remi,

Are you running the first VLC instance without a video stream coming in? If so, which version of VLC are you using? I've tried this on multiple Windows XP PCs with versions 1.05 and 0.99 and the problem exists.

Thanks,
Sean

Re: VLC 1.0.5 Defect

Posted: 15 Feb 2010 20:19
by Rémi Denis-Courmont
Tried cDebian VLC 1.0.5 and a custom VLC 1.1.0-git.

Re: VLC 1.0.5 Defect

Posted: 15 Feb 2010 20:46
by SeanJanis
Remi,

To ensure we're doing the same test, try this from a Windows Command Line:

Launch a VLC Server:
vlc.exe -vvv rtp://@127.0.0.1:5004 :sout=#transcode{vcodec=mp4v,vb=800,scale=1,acodec=none}
:duplicate{dst=rtp{dst=127.0.0.1,ttl=127,sdp=rtsp://127.0.0.1:554/test.sdp}}

Launch the VLC Client:
vlc.exe -vvv rtsp://127.0.0.1:554/test.sdp

On my end, when launching the client, the VLC Server immediately crashes because it can't serve up the 127.0.0.1:5004 stream to the requesting client.

If I create another VLC instance that feeds in on the 127.0.0.1:5004 link, the VLC Server instance doesn't crash because it now has data to send to the client. Thanks again for your help, I appreciate it.

Sean

Re: VLC 1.0.5 Defect

Posted: 15 Feb 2010 20:50
by Rémi Denis-Courmont
I don't use Windows.

Re: VLC 1.0.5 Defect

Posted: 15 Feb 2010 21:10
by SeanJanis
Is there anyone on the VLC developer team or someone you could forward this to that does use Windows and could verify the issue? Thanks again -

Re: VLC 1.0.5 Defect

Posted: 16 Feb 2010 20:27
by SeanJanis
Remi,

I found a similar forum posting from a while back which is similar to my RTSP/SDP issue and you were involved with:

viewtopic.php?f=4&p=238918

Do you remember the resolution for this issue?

Thanks again,
Sean

Re: VLC 1.0.5 Defect

Posted: 17 Feb 2010 17:50
by SeanJanis
Remi,

I was able to find a solution to the problem I detailed. Basically, in the VLC source /modules/stream_out/rtp.c, there is an SDPGenerate method which gets invoked when the VLC Client requests an SDP. If there is not an incoming stream on the server side, this method is still called and the SDP stream is served as usual.

However, there seems to be an invalid pointer access at the line:

Code: Select all

if( p_sys->es[0]->listen_fd != NULL )
It seems the p_sys->es member variable is NULL and the code is trying to access an 'es' array index. So, to prevent this from occuring, I do a simple NULL check before allowing the offending line of code to be invoked:

Code: Select all

if (p_sys->es == NULL) { return NULL; }
The server side VLC instance does not crash anymore.