[vlc-devel] [PATCH 1/2] win32: sensors: do not sent a temporary address

Steve Lhomme robux4 at ycbcr.xyz
Wed Jul 17 11:46:43 CEST 2019


Indeed, I was wondering this could even work since it's been like that 
since it was introduced.

On the other hand there's no guarantee that someone my read the variable 
later and end up on this pointer. But then there's no guarantee the 
sensor instance will even be loaded at that time either. So I guess 
that's a given for now that it's the only way to use "viewpoint-moved".

On 2019-07-17 11:38, Rémi Denis-Courmont wrote:
> Hi,
> 
> I don't really see the point. The callees have to read the data synchronously, as there are no guarantees later that the storage space has not been overwritten.
> 
> Le 17 juillet 2019 11:57:09 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>> It's not converted to a value but used as an address.
>> ---
>> modules/video_output/win32/sensors.cpp | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/modules/video_output/win32/sensors.cpp
>> b/modules/video_output/win32/sensors.cpp
>> index 17727afaad..f256cf3e7f 100644
>> --- a/modules/video_output/win32/sensors.cpp
>> +++ b/modules/video_output/win32/sensors.cpp
>> @@ -123,13 +123,13 @@ public:
>>              PropVariantClear(&pvRot);
>>          }
>>
>> -        vlc_viewpoint_t vp = {
>> +        sent_pos = {
>>              old_pos.yaw   - current_pos.yaw,
>>              old_pos.pitch - current_pos.pitch,
>>              old_pos.roll  - current_pos.roll,
>>              0.0f
>>          };
>> -        vout_display_SendEventViewpointMoved(vd, &vp);
>> +        vout_display_SendEventViewpointMoved(vd, &sent_pos);
>>          return S_OK;
>>      }
>>
>> @@ -150,6 +150,7 @@ public:
>> private:
>>      vout_display_t *const vd;
>>      vlc_viewpoint_t current_pos;
>> +    vlc_viewpoint_t sent_pos;
>>      long m_cRef;
>> };
>>
>> -- 
>> 2.17.1
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> 
> -- 
> 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
> 


More information about the vlc-devel mailing list