Page 1 of 1

crash inside decoder_SynchroNewPicture

Posted: 30 Aug 2009 22:34
by XilasZ
Hi, i recently installed Windbg to get some info when libvlc cause my program to crash.

And sometimes, a crash occurs in decoder_SynchroNewPicture, which seems to be called by the mpeg2 decoder.
Here is the callstack from windbg, when using the latest 1.0.2 nightly build (debug) :

Code: Select all

RawArgs to Child 00000000 00000001 00000002 libvlccore!decoder_SynchroNewPicture+0x2b 05df5fe4 0dfdfe2c 000005d0 liblibmpeg2_plugin!vlc_entry__1_0_0e+0x1cc5 0cab39b0 00000014 00000001 libvlccore!input_DecoderDecode+0x1950 0cab39b0 0dfdff48 05e14bc8 libvlccore!input_DecoderDecode+0x14cf 05df5fe4 00000003 6a65a145 libvlccore!input_DecoderDecode+0x2008 0cb6ec88 0dfdff74 00000000 libvlccore!_vlc_thread_set_priority+0xd4 0cb752b0 0000000c 000005d0 libvlccore!vlc_threadvar_set+0x67 0ca3e150 0000000c 000005d0 msvcrt!endthreadex+0xa9 77c0a341 0ca3e150 00000000 KERNEL32!GetModuleFileNameA+0x1ba
It happens randomly when changing stream (stop the current one, start another).
It seems the decoder is still trying to work between the streams, and call decoder_SynchroNewPicture with a null pointer.

Re: crash inside decoder_SynchroNewPicture

Posted: 30 Aug 2009 23:57
by Jean-Baptiste Kempf
try to run VLC with --codec avcodec

Re: crash inside decoder_SynchroNewPicture

Posted: 31 Aug 2009 00:23
by XilasZ
i tried it with vlc, it changes the codec used, and maybe is a good workaround for the issue, but it also add a worse one :
i don't have any sound with an h264+mpeg4audio stream (and maybe other type of streams too) !!!!!!!!!

Re: crash inside decoder_SynchroNewPicture

Posted: 31 Aug 2009 17:13
by Jean-Baptiste Kempf
Try --codec faad,avcodec :D

Re: crash inside decoder_SynchroNewPicture

Posted: 31 Aug 2009 20:52
by XilasZ
cheater :lol:
Sound is working for h264+mpeg4audio streams.

But it's still a workaround. Maybe other kind of streams won't work.
And that doesn't solve the mpeg2 bug (a simple "if (!p_synchro) return;" may fix it), or the missing sound bug somewhere in avcodec :P

Edit: so far, no more crash, i'll keep testing.

But i found another weird bug: when recording and displaying an h264+mpeg4audio stream (so using sout=#duplicate{dst=display,dst=std{access=file,mux=ts,dst="test.ts"}}), vlc displays the stream, but the width is almost doubled (libvlc reports a size of 3811x1080, but the stream is 1440x1080 with a 16/9 ratio, so it should report 1920x1080). It happens with vlc too, and no need to record the stream.
Adding "sout=#display" shouldn't have any effect, but the width is doubled :mrgreen:

Re: crash inside decoder_SynchroNewPicture

Posted: 01 Sep 2009 00:02
by Jean-Baptiste Kempf
Other solution is to remove the libmpeg2 plugin.

Re: crash inside decoder_SynchroNewPicture

Posted: 01 Sep 2009 07:51
by XilasZ
Other solution is to remove the libmpeg2 plugin.
It's still a workaround (even if it's working).


What about this :
But i found another weird bug: when recording and displaying an h264+mpeg4audio stream (so using sout=#duplicate{dst=display,dst=std{access=file,mux=ts,dst="test.ts"}}), vlc displays the stream, but the width is almost doubled (libvlc reports a size of 3811x1080, but the stream is 1440x1080 with a 16/9 ratio, so it should report 1920x1080). It happens with vlc too, and no need to record the stream.
Adding "sout=#display" shouldn't have any effect, but the width is doubled :mrgreen:

Re: crash inside decoder_SynchroNewPicture

Posted: 01 Sep 2009 10:27
by Jean-Baptiste Kempf
What about this :
But i found another weird bug: when recording and displaying an h264+mpeg4audio stream (so using sout=#duplicate{dst=display,dst=std{access=file,mux=ts,dst="test.ts"}}), vlc displays the stream, but the width is almost doubled (libvlc reports a size of 3811x1080, but the stream is 1440x1080 with a 16/9 ratio, so it should report 1920x1080). It happens with vlc too, and no need to record the stream.
Adding "sout=#display" shouldn't have any effect, but the width is doubled :mrgreen:
Sorry, no idea..

Re: crash inside decoder_SynchroNewPicture

Posted: 02 Sep 2009 12:12
by XilasZ
Thanks anyway, with the --codec workaround, and the few bug i fixed, my program doesn't crash anymore (yet :p).

Re: crash inside decoder_SynchroNewPicture

Posted: 02 Sep 2009 12:23
by Jean-Baptiste Kempf
Does VLC crash on such streams?

Re: crash inside decoder_SynchroNewPicture

Posted: 02 Sep 2009 15:33
by XilasZ
I have no idea if vlc can crash because of decoder_SynchroNewPicture. I guess it could.
To force the crash to happens, i modified my program to switch stream each 3 or 4 second, but i can't do that with vlc :p

the width issue happens with both libvlc and vlc, but no crash.