[vlc-devel] [PATCH 32/33] chromecast: the stream cannot work if the communication handler is NULL

Steve Lhomme robux4 at gmail.com
Wed Dec 23 21:36:51 CET 2015


On Wed, Dec 23, 2015 at 9:31 PM, Hugo Beauzée-Luyssen <hugo at beauzee.fr> wrote:
> On 12/23/2015 09:28 PM, Steve Lhomme wrote:
>>
>> On Wed, Dec 23, 2015 at 5:26 PM, Hugo Beauzée-Luyssen <hugo at beauzee.fr>
>> wrote:
>>>
>>> On 12/23/2015 12:58 PM, Steve Lhomme wrote:
>>>>
>>>>
>>>> ---
>>>>    modules/stream_out/chromecast/cast.cpp | 3 +++
>>>>    1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/modules/stream_out/chromecast/cast.cpp
>>>> b/modules/stream_out/chromecast/cast.cpp
>>>> index 6fd0784..7302f9d 100644
>>>> --- a/modules/stream_out/chromecast/cast.cpp
>>>> +++ b/modules/stream_out/chromecast/cast.cpp
>>>> @@ -34,12 +34,15 @@
>>>>    #include <vlc_sout.h>
>>>>    #include <vlc_threads.h>
>>>>
>>>> +#include <cassert>
>>>> +
>>>>    struct sout_stream_sys_t
>>>>    {
>>>>        sout_stream_sys_t(intf_sys_t *intf)
>>>>            : p_out(NULL)
>>>>            , p_intf(intf)
>>>>        {
>>>> +        assert(p_intf != NULL);
>>>>        }
>>>>
>>>>        ~sout_stream_sys_t()
>>>>
>>> You could take a reference to ensure this using the language itself,
>>> though
>>> it obviously doesn't remove the need for a check in the caller.
>>
>>
>> True, also this is not a refcounted type (_sys_t) so at this stage we
>> can't have a reference.
>>
>
> I'm not sure I understand what you mean?

By reference I thought you meant a vlc_object_t with vlc_object_hold().

Now I understand you meant using a & which is indeed better.

> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list