Fix: warnings in media/capture/filters 88/307088/2
authorLeonid <l.sawin@samsung.com>
Mon, 4 Mar 2024 14:53:57 +0000 (15:53 +0100)
committerDae-Hyun Ko <dhyuna.ko@samsung.com>
Thu, 14 Mar 2024 08:03:29 +0000 (08:03 +0000)
Minor patch to speed-up compilation times and
 avoid potential undefined behaviors

Change-Id: I25834d8ea711df6f1d094deee39dd3e4c8faef48
Signed-off-by: Leonid <l.sawin@samsung.com>
tizen_src/chromium_impl/media/capture/video/tizen/video_capture_device_tizen.cc
tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc

index 69836c0..729eff0 100644 (file)
@@ -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);
index b843150..9c7290d 100644 (file)
@@ -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);