@@ -73,8 +73,9 @@ class PlayerEvents : public PlayerGetters {
73
73
playlist_callback_ = callback;
74
74
}
75
75
76
- void OnVideo (std::function<void (uint8_t * frame, int32_t width,
77
- int32_t height)> callback) {
76
+ void OnVideo (
77
+ std::function<void (uint8_t * frame, int32_t width, int32_t height)>
78
+ callback) {
78
79
video_callback_ = callback;
79
80
}
80
81
@@ -114,8 +115,8 @@ class PlayerEvents : public PlayerGetters {
114
115
open_callback_ (*vlc_media_ptr.get ());
115
116
}
116
117
117
- std::function<void (int32_t , int32_t )> video_dimension_callback_ = [=](
118
- int32_t , int32_t ) -> void {};
118
+ std::function<void (int32_t , int32_t )> video_dimension_callback_ =
119
+ [=]( int32_t , int32_t ) -> void {};
119
120
120
121
void OnVideoDimensionsCallback () {
121
122
int32_t video_width = preferred_video_width_.has_value ()
@@ -126,7 +127,7 @@ class PlayerEvents : public PlayerGetters {
126
127
? preferred_video_height_.value ()
127
128
: libvlc_video_get_height (vlc_media_player_.get ());
128
129
video_dimension_callback_ (video_width, video_height);
129
- if (video_width_ != video_width && video_height_ != video_height) {
130
+ if (video_width_ != video_width || video_height_ != video_height) {
130
131
video_width_ = video_width;
131
132
video_height_ = video_height;
132
133
int32_t pitch = video_width * 4 ;
@@ -135,8 +136,9 @@ class PlayerEvents : public PlayerGetters {
135
136
vlc_media_player_.setVideoCallbacks (
136
137
std::bind (&PlayerEvents::OnVideoLockCallback, this ,
137
138
std::placeholders::_1),
138
- nullptr , std::bind (&PlayerEvents::OnVideoPictureCallback, this ,
139
- std::placeholders::_1));
139
+ nullptr ,
140
+ std::bind (&PlayerEvents::OnVideoPictureCallback, this ,
141
+ std::placeholders::_1));
140
142
vlc_media_player_.setVideoFormatCallbacks (
141
143
[=](char * chroma, uint32_t * w, uint32_t * h, uint32_t * p,
142
144
uint32_t * l) -> int32_t {
@@ -188,8 +190,8 @@ class PlayerEvents : public PlayerGetters {
188
190
stop_callback_ ();
189
191
}
190
192
191
- std::function<void (int32_t )> position_callback_ = [=](
192
- int32_t position) -> void {};
193
+ std::function<void (int32_t )> position_callback_ =
194
+ [=]( int32_t position) -> void {};
193
195
194
196
void OnPositionCallback (float relative_position) {
195
197
state ()->is_playing_ = vlc_media_player_.isPlaying ();
@@ -232,8 +234,8 @@ class PlayerEvents : public PlayerGetters {
232
234
233
235
std::function<void (float )> rate_callback_ = [=](float ) -> void {};
234
236
235
- std::function<void (uint8_t *, int32_t , int32_t )> video_callback_ = [=](
236
- uint8_t *, int32_t width, int32_t height) -> void {};
237
+ std::function<void (uint8_t *, int32_t , int32_t )> video_callback_ =
238
+ [=]( uint8_t *, int32_t width, int32_t height) -> void {};
237
239
238
240
void * OnVideoLockCallback (void ** planes) {
239
241
planes[0 ] = static_cast <void *>(video_frame_buffer_.get ());
0 commit comments