| Index: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
|
| diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
|
| index 8c798db66529b5131d63aaa218e8c6f419cac2e7..a4f74b7b44c3b2bfd401c9192dfb07f29be25497 100644
|
| --- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
|
| +++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
|
| @@ -256,6 +256,10 @@ int VP9EncoderImpl::InitEncode(const VideoCodec* inst,
|
| }
|
| if (encoder_ == NULL) {
|
| encoder_ = new vpx_codec_ctx_t;
|
| + // Only randomize pid/tl0 the first time the encoder is initialized
|
| + // in order to not make random jumps mid-stream.
|
| + picture_id_ = static_cast<uint16_t>(rand()) & 0x7FFF; // NOLINT
|
| + tl0_pic_idx_ = static_cast<uint8_t>(rand()); // NOLINT
|
| }
|
| if (config_ == NULL) {
|
| config_ = new vpx_codec_enc_cfg_t;
|
| @@ -270,8 +274,6 @@ int VP9EncoderImpl::InitEncode(const VideoCodec* inst,
|
| if (num_temporal_layers_ == 0)
|
| num_temporal_layers_ = 1;
|
|
|
| - // Random start 16 bits is enough.
|
| - picture_id_ = static_cast<uint16_t>(rand()) & 0x7FFF; // NOLINT
|
| // Allocate memory for encoded image
|
| if (encoded_image_._buffer != NULL) {
|
| delete[] encoded_image_._buffer;
|
| @@ -366,8 +368,6 @@ int VP9EncoderImpl::InitEncode(const VideoCodec* inst,
|
| return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
|
| }
|
|
|
| - tl0_pic_idx_ = static_cast<uint8_t>(rand()); // NOLINT
|
| -
|
| return InitAndSetControlSettings(inst);
|
| }
|
|
|
|
|