From: Leonid Date: Mon, 4 Mar 2024 14:53:57 +0000 (+0100) Subject: Fix: warnings in media/capture/filters X-Git-Tag: accepted/tizen/unified/20240315.155154~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86cc615513a96347c2da5511f5ea0d302758a1db;p=platform%2Fframework%2Fweb%2Fchromium-efl.git Fix: warnings in media/capture/filters Minor patch to speed-up compilation times and avoid potential undefined behaviors Change-Id: I25834d8ea711df6f1d094deee39dd3e4c8faef48 Signed-off-by: Leonid --- diff --git a/tizen_src/chromium_impl/media/capture/video/tizen/video_capture_device_tizen.cc b/tizen_src/chromium_impl/media/capture/video/tizen/video_capture_device_tizen.cc index 69836c0..729eff0 100644 --- a/tizen_src/chromium_impl/media/capture/video/tizen/video_capture_device_tizen.cc +++ b/tizen_src/chromium_impl/media/capture/video/tizen/video_capture_device_tizen.cc @@ -510,7 +510,7 @@ void VideoCaptureDeviceTizen::OnCameraCaptured(camera_preview_data_s* frame, int dest_width = frame->width; int dest_height = frame->height; #if !BUILDFLAG(IS_TIZEN_TV) - if (target_rotation == 90 || target_rotation == 270) + if ((target_rotation == 90) || (target_rotation == 270)) std::swap(dest_height, dest_width); #endif videocaptureformat.frame_size = gfx::Size(dest_width, dest_height); diff --git a/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc b/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc index b843150..9c7290d 100644 --- a/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc +++ b/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc @@ -346,7 +346,7 @@ bool MediaPlayerESPlusPlayer::Play() { esplusplayer_state state = GetPlayerState(); is_paused_ = false; - if (state < ESPLUSPLAYER_STATE_READY || !is_prepared_ || is_seeking_) { + if ((state < ESPLUSPLAYER_STATE_READY) || !is_prepared_ || is_seeking_) { LOG(INFO) << "state : " << GetString(state) << " is_prepared : " << is_prepared_ << " is_seeking : " << is_seeking_ @@ -366,8 +366,8 @@ bool MediaPlayerESPlusPlayer::Play() { if (state == ESPLUSPLAYER_STATE_READY) error = esplusplayer_start(esplayer_); - else if (state == ESPLUSPLAYER_STATE_PAUSED || - state == ESPLUSPLAYER_STATE_PLAYING) + else if ((state == ESPLUSPLAYER_STATE_PAUSED) || + (state == ESPLUSPLAYER_STATE_PLAYING)) error = esplusplayer_resume(esplayer_); if (error != ESPLUSPLAYER_ERROR_TYPE_NONE) { @@ -464,7 +464,7 @@ void MediaPlayerESPlusPlayer::Seek(base::TimeDelta time, return; } - if (GetPlayerState() < ESPLUSPLAYER_STATE_READY || !is_prepared_) { + if ((GetPlayerState() < ESPLUSPLAYER_STATE_READY) || !is_prepared_) { // Prevent to set the same pending seek position and // stop pushing again from 0sec when media starts 0. if (time == pending_seek_position_) { @@ -818,8 +818,8 @@ bool MediaPlayerESPlusPlayer::ReadFromBufferQueue(DemuxerStream::Type type) { return false; } - if (status == ESPLUSPLAYER_SUBMIT_STATUS_NOT_PREPARED || - status == ESPLUSPLAYER_SUBMIT_STATUS_OUT_OF_MEMORY) + if ((status == ESPLUSPLAYER_SUBMIT_STATUS_NOT_PREPARED) || + (status == ESPLUSPLAYER_SUBMIT_STATUS_OUT_OF_MEMORY)) return false; UpdateBufferedDtsDifference(); @@ -1042,8 +1042,8 @@ void MediaPlayerESPlusPlayer::OnReadyToPrepare( LOG(INFO) << "OnReadyToPrepare : " << DemuxerStream::GetTypeName(GetDemuxerStreamType(stream_type)); - if (stream_type != ESPLUSPLAYER_STREAM_TYPE_AUDIO && - stream_type != ESPLUSPLAYER_STREAM_TYPE_VIDEO) + if ((stream_type != ESPLUSPLAYER_STREAM_TYPE_AUDIO) && + (stream_type != ESPLUSPLAYER_STREAM_TYPE_VIDEO)) return; DemuxerStream::Type type = GetDemuxerStreamType(stream_type);