Stop playing song in a stream filter plugin

This forum is about all development around libVLC.
j_vlc
Blank Cone
Blank Cone
Posts: 16
Joined: 11 Mar 2013 13:03

Stop playing song in a stream filter plugin

Postby j_vlc » 18 Apr 2013 15:48

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!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Stop playing song in a stream filter plugin

Postby Jean-Baptiste Kempf » 18 Apr 2013 16:06

Just return 0.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

j_vlc
Blank Cone
Blank Cone
Posts: 16
Joined: 11 Mar 2013 13:03

Re: Stop playing song in a stream filter plugin

Postby j_vlc » 18 Apr 2013 16:12

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!

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Stop playing song in a stream filter plugin

Postby Rémi Denis-Courmont » 18 Apr 2013 17:37

Peek() is mostly called in file format probing phase. If it fails, VLC will always shows the error message.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

j_vlc
Blank Cone
Blank Cone
Posts: 16
Joined: 11 Mar 2013 13:03

Re: Stop playing song in a stream filter plugin

Postby j_vlc » 18 Apr 2013 17:45

Ok! Thank you very much, I'll try to bypass this problem as possible...


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests