Commit 24715c79 authored by Deb Mukherjee's avatar Deb Mukherjee Committed by Gerrit Code Review

Merge "Fix FrameSizeTestsLarge unit-test on 32-bit arch."

parents 727f3840 bdbaa5b4
......@@ -69,7 +69,10 @@ void Encoder::EncodeFrameInternal(const VideoSource &video,
void Encoder::Flush() {
const vpx_codec_err_t res = vpx_codec_encode(&encoder_, NULL, 0, 0, 0,
deadline_);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
if (!encoder_.priv)
ASSERT_EQ(VPX_CODEC_ERROR, res) << EncoderError();
else
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void EncoderTest::InitializeConfig() {
......
......@@ -142,7 +142,7 @@ class DummyVideoSource : public VideoSource {
}
protected:
virtual void FillFrame() { memset(img_->img_data, 0, raw_sz_); }
virtual void FillFrame() { if (img_) memset(img_->img_data, 0, raw_sz_); }
vpx_image_t *img_;
size_t raw_sz_;
......@@ -170,11 +170,13 @@ class RandomVideoSource : public DummyVideoSource {
// 15 frames of noise, followed by 15 static frames. Reset to 0 rather
// than holding previous frames to encourage keyframes to be thrown.
virtual void FillFrame() {
if (frame_ % 30 < 15)
for (size_t i = 0; i < raw_sz_; ++i)
img_->img_data[i] = rnd_.Rand8();
else
memset(img_->img_data, 0, raw_sz_);
if (img_) {
if (frame_ % 30 < 15)
for (size_t i = 0; i < raw_sz_; ++i)
img_->img_data[i] = rnd_.Rand8();
else
memset(img_->img_data, 0, raw_sz_);
}
}
ACMRandom rnd_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment