You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
@@ -208,10 +208,12 @@ VideoStreamPlaybackGDNative::~VideoStreamPlaybackGDNative() {
|
||||
}
|
||||
|
||||
void VideoStreamPlaybackGDNative::cleanup() {
|
||||
if (data_struct)
|
||||
if (data_struct) {
|
||||
interface->destructor(data_struct);
|
||||
if (pcm)
|
||||
}
|
||||
if (pcm) {
|
||||
memfree(pcm);
|
||||
}
|
||||
pcm = nullptr;
|
||||
time = 0;
|
||||
num_channels = -1;
|
||||
@@ -257,8 +259,9 @@ void VideoStreamPlaybackGDNative::stop() {
|
||||
void VideoStreamPlaybackGDNative::seek(float p_time) {
|
||||
ERR_FAIL_COND(interface == nullptr);
|
||||
interface->seek(data_struct, p_time);
|
||||
if (p_time < time)
|
||||
if (p_time < time) {
|
||||
seek_backward = true;
|
||||
}
|
||||
time = p_time;
|
||||
// reset audio buffers
|
||||
memset(pcm, 0, num_channels * AUX_BUFFER_SIZE * sizeof(float));
|
||||
@@ -320,12 +323,14 @@ int VideoStreamPlaybackGDNative::get_mix_rate() const {
|
||||
Ref<VideoStreamPlayback> VideoStreamGDNative::instance_playback() {
|
||||
Ref<VideoStreamPlaybackGDNative> pb = memnew(VideoStreamPlaybackGDNative);
|
||||
VideoDecoderGDNative *decoder = decoder_server.get_decoder(file.get_extension().to_lower());
|
||||
if (decoder == nullptr)
|
||||
if (decoder == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
pb->set_interface(decoder->interface);
|
||||
pb->set_audio_track(audio_track);
|
||||
if (pb->open_file(file))
|
||||
if (pb->open_file(file)) {
|
||||
return pb;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -382,7 +387,8 @@ bool ResourceFormatLoaderVideoStreamGDNative::handles_type(const String &p_type)
|
||||
|
||||
String ResourceFormatLoaderVideoStreamGDNative::get_resource_type(const String &p_path) const {
|
||||
String el = p_path.get_extension().to_lower();
|
||||
if (VideoDecoderServer::get_instance()->get_extensions().has(el))
|
||||
if (VideoDecoderServer::get_instance()->get_extensions().has(el)) {
|
||||
return "VideoStreamGDNative";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user