summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/AVIDump.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-07 20:33:54 -0700
committerGitHub <noreply@github.com>2017-06-07 20:33:54 -0700
commitb11d722eeda67bc498f7bf727649fb4ae4e5f997 (patch)
tree597b9596564442ac1c125f5f7332ffc6ec97ce03 /Source/Core/VideoCommon/AVIDump.cpp
parente6aa118f2111351c7fb38a611f3523793927addb (diff)
parentfd166032abec349b9fae7240830133bf7e0c77b5 (diff)
Merge pull request #5572 from shuffle2/msvc-w4
msvc: use /W4 (and fixes to make it work)
Diffstat (limited to 'Source/Core/VideoCommon/AVIDump.cpp')
-rw-r--r--Source/Core/VideoCommon/AVIDump.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp
index dc4e806f6a..6a7590f034 100644
--- a/Source/Core/VideoCommon/AVIDump.cpp
+++ b/Source/Core/VideoCommon/AVIDump.cpp
@@ -159,8 +159,9 @@ bool AVIDump::CreateVideoFile()
const AVCodec* codec = nullptr;
- if (!(codec = avcodec_find_encoder(codec_id)) ||
- !(s_codec_context = avcodec_alloc_context3(codec)))
+ codec = avcodec_find_encoder(codec_id);
+ s_codec_context = avcodec_alloc_context3(codec);
+ if (!codec || !s_codec_context)
{
ERROR_LOG(VIDEO, "Could not find encoder or allocate codec context");
return false;
@@ -203,8 +204,8 @@ bool AVIDump::CreateVideoFile()
return false;
#endif
- if (!(s_stream = avformat_new_stream(s_format_context, codec)) ||
- !AVStreamCopyContext(s_stream, s_codec_context))
+ s_stream = avformat_new_stream(s_format_context, codec);
+ if (!s_stream || !AVStreamCopyContext(s_stream, s_codec_context))
{
ERROR_LOG(VIDEO, "Could not create stream");
return false;
@@ -299,9 +300,10 @@ void AVIDump::AddFrame(const u8* data, int width, int height, int stride, const
s_src_frame->height = s_height;
// Convert image from {BGR24, RGBA} to desired pixel format
- if ((s_sws_context =
- sws_getCachedContext(s_sws_context, width, height, s_pix_fmt, s_width, s_height,
- s_codec_context->pix_fmt, SWS_BICUBIC, nullptr, nullptr, nullptr)))
+ s_sws_context =
+ sws_getCachedContext(s_sws_context, width, height, s_pix_fmt, s_width, s_height,
+ s_codec_context->pix_fmt, SWS_BICUBIC, nullptr, nullptr, nullptr);
+ if (s_sws_context)
{
sws_scale(s_sws_context, s_src_frame->data, s_src_frame->linesize, 0, height,
s_scaled_frame->data, s_scaled_frame->linesize);