[vlc-devel] [PATCH 1/2] test: demux-run: add libvlc_demux_process_memory

Thomas Guillem thomas at gllm.fr
Thu Feb 21 09:22:16 CET 2019


On Thu, Feb 21, 2019, at 09:20, Thomas Guillem wrote:
> 
> On Thu, Feb 21, 2019, at 06:57, Rémi Denis-Courmont wrote:
>> Hi,
>> 
>> This would work properly if demuxers never modified the configuration, or texl'heir parent objects, etc. But because some of them do (AFAIR), this leaks unreproducible state into the testing.
> 
> Which ones ?
> I grepped variable and config changes in all demuxers/codec/packetizers.
> There are not config change at all and all variable changes are done on current objects.
> 
> So I don't see any unreproducible state for now.

Maybe some access_demux like bluray/dvd changed global variables in the past but I fixed it when I did the input_thread_t cleanup.

> 
>> 
>> Which would somewhat obviously be a very bad thing.
>> 
>> Le 20 février 2019 19:40:07 GMT+02:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>>> Same than vlc_demux_process_memory but with a libvlc_instance_t arg. test/src/input/demux-run.c | 19 +++++++++++++------
>>>  test/src/input/demux-run.h |  3 +++
>>>  2 files changed, 16 insertions(+), 6 deletions(-)
>>> 
>>> diff --git a/test/src/input/demux-run.c b/test/src/input/demux-run.c
>>> index fe9ce530b5..8178756ed6 100644
>>> --- a/test/src/input/demux-run.c
>>> +++ b/test/src/input/demux-run.c
>>> @@ -363,6 +363,18 @@ int vlc_demux_process_path(const struct vlc_run_args *args, const char *path)
>>>      return ret;
>>>  }
>>>  
>>> +int libvlc_demux_process_memory(libvlc_instance_t *vlc,
>>> +                                const struct vlc_run_args *args,
>>> +                                const unsigned char *buf, size_t length)
>>> +{
>>> +    stream_t *s = vlc_stream_MemoryNew(VLC_OBJECT(vlc->p_libvlc_int),
>>> +                                       (void *)buf, length, true);
>>> +    if (s == NULL)
>>> +        fprintf(stderr, "Error: cannot create input stream\n");
>>> +
>>> +    return demux_process_stream(args, s);
>>> +}
>>> +
>>>  int vlc_demux_process_memory(const struct vlc_run_args *args,
>>>                               const unsigned char *buf, size_t length)
>>>  {
>>> @@ -370,12 +382,7 @@ int vlc_demux_process_memory(const struct vlc_run_args *args,
>>>      if (vlc == NULL)
>>>          return -1;
>>>  
>>> -    stream_t *s = vlc_stream_MemoryNew(VLC_OBJECT(vlc->p_libvlc_int),
>>> -                                       (void *)buf, length, true);
>>> -    if (s == NULL)
>>> -        fprintf(stderr, "Error: cannot create input stream\n");
>>> -
>>> -    int ret = demux_process_stream(args, s);
>>> +    int ret = libvlc_demux_process_memory(vlc, args, buf, length);
>>>      libvlc_release(vlc);
>>>      return ret;
>>>  }
>>> diff --git a/test/src/input/demux-run.h b/test/src/input/demux-run.h
>>> index 01ae245891..551f002770 100644
>>> --- a/test/src/input/demux-run.h
>>> +++ b/test/src/input/demux-run.h
>>> @@ -30,3 +30,6 @@ int vlc_demux_process_url(const struct vlc_run_args *, const char *url);
>>>  int vlc_demux_process_path(const struct vlc_run_args *, const char *path);
>>>  int vlc_demux_process_memory(const struct vlc_run_args *,
>>>                               const unsigned char *buf, size_t length);
>>> +int libvlc_demux_process_memory(libvlc_instance_t *vlc,
>>> +                                const struct vlc_run_args *args,
>>> +                                const unsigned char *buf, size_t length);
>> 
>> -- 
>> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190221/4e5d8c9b/attachment.html>


More information about the vlc-devel mailing list