[vlc-devel] Resubmitting [PATCH] npapi plugin slave-input support Add the ability to specify a sound source through slave-input, for example a v4l video capture device with alsa audio. Now with added buffer overflow protection.

Sergey Radionov rsatom at gmail.com
Wed Mar 21 14:13:04 CET 2012



On 21.03.2012 19:59, Tord Andersson wrote:
> On 2012-03-21 12.31, Sergey Radionov wrote:
>>
>>
>> On 21.03.2012 17:56, Tord Andersson wrote:
>>> On 2012-03-20 15.41, Sergey Radionov wrote:
>>>> 2012/3/20 Tord Andersson<tord.andersson at endian.se>:
>>>>> ---
>>>>>    npapi/vlcplugin_base.cpp |    6 ++++++
>>>>>    1 files changed, 6 insertions(+), 0 deletions(-)
>>>>>
>>>>> diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
>>>>> index 1d9db49..3beee35 100644
>>>>> --- a/npapi/vlcplugin_base.cpp
>>>>> +++ b/npapi/vlcplugin_base.cpp
>>>>> @@ -464,6 +464,12 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
>>>>>           {
>>>>>               set_enable_fs( boolValue(argv[i]) );
>>>>>           }
>>>>> +        else if( !strcmp( argn[i], "input-slave" ) )
>>>>> +        {
>>>>> +            char psz_input_slave_opts[80] = "--input-slave=";
>>>> why exactly 80? why no use std::vector for example?
>>> I tried to stay in line with the rest of the code.
>>> 80 characters was just an idea of how much would be needed.
>>> I guess, some kind of limit is probably needed.
>> don't know, maybe. I am not sure at 100%...
>>
>>> As also pointed out, the variable should be moved to the scope above.
>>>>
>>>>> +            strncat(psz_input_slave_opts, argv[i], sizeof(psz_input_slave_opts) - strlen(psz_input_slave_opts) - 1);
>>>> or that option can't be more than "sizeof(psz_input_slave_opts) -
>>>> strlen(psz_input_slave_opts) - 1" ?
>>>>
>>> Yes. It's typically a string such as   "--input-slave=alsa://hw:2,0"
>>
>> btw, what about ActiveX?
>>
> I don't know. I have only tested the option on linux/alsa. Maybe you can give some input on ActiveX implications?
if you don't familiar with ActiveX - not a problem I'll try to do it by myself...
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>

-- 
With best wishes,
Sergey Radionov (aka RSATom).

  *
  * English
  * Russian

  * English
  * Russian

  <javascript:void(0);>



More information about the vlc-devel mailing list