Page 1 of 1

Stop playing song in a stream filter plugin

Posted: 18 Apr 2013 15:48
by j_vlc
Hi!

I need to stop "Peek" a multimedia file in my stream filter plugin if an error occurs. I'm doing it like that:

Code: Select all

static int Peek(stream_t *stream, const uint8_t **pbuf, unsigned int len) { stream_sys_t *p_sys = stream->p_sys; if (stream->b_error) return VLC_EGENERIC; QByteArray peekBuffer = p_sys->bufferManager->getBuffer(p_sys->offset, len); if (peekBuffer.isNull()) { stream->b_error = true; return VLC_EGENERIC; } *pbuf = (const uint8_t *)peekBuffer.constData(); return len; }
It stops correctly, but the "Errors and Warnings" window appears when I stop the song like that with a "VLC can not recognize the input format" error.

Someone can help me to stop the song without show this windows please?
Thank you very much!

Re: Stop playing song in a stream filter plugin

Posted: 18 Apr 2013 16:06
by Jean-Baptiste Kempf
Just return 0.

Re: Stop playing song in a stream filter plugin

Posted: 18 Apr 2013 16:12
by j_vlc
The same problem returning 0... I'm testing with the Mac OS X user interface, I don't know if it happens with the Qt interface too. Thanks for the rapid answer!

Re: Stop playing song in a stream filter plugin

Posted: 18 Apr 2013 17:37
by RĂ©mi Denis-Courmont
Peek() is mostly called in file format probing phase. If it fails, VLC will always shows the error message.

Re: Stop playing song in a stream filter plugin

Posted: 18 Apr 2013 17:45
by j_vlc
Ok! Thank you very much, I'll try to bypass this problem as possible...