@@ -64,7 +64,6 @@ int32_t VideoReceiveAdapterImpl::AdapterDecoder::Decode(const webrtc::EncodedIma
6464{
6565 RTC_DLOG (LS_VERBOSE) << " AdapterDecoder Decode" ;
6666 owt_base::FrameFormat format = FRAME_FORMAT_UNKNOWN;
67- bool notifyStats = false ;
6867
6968 switch (m_codec) {
7069 case webrtc::VideoCodecType::kVideoCodecVP8 :
@@ -90,15 +89,20 @@ int32_t VideoReceiveAdapterImpl::AdapterDecoder::Decode(const webrtc::EncodedIma
9089 RTC_DLOG (LS_INFO) << " AdapterDecoder increase buffer size: " << m_bufferSize;
9190 }
9291
92+ if (encodedImage._encodedWidth > 0 && encodedImage._encodedHeight > 0 ) {
93+ m_width = encodedImage._encodedWidth ;
94+ m_height = encodedImage._encodedHeight ;
95+ }
96+
9397 memcpy (m_frameBuffer.get (), encodedImage.data (), encodedImage.size ());
9498 Frame frame;
9599 memset (&frame, 0 , sizeof (frame));
96100 frame.format = format;
97101 frame.payload = m_frameBuffer.get ();
98102 frame.length = encodedImage.size ();
99103 frame.timeStamp = encodedImage.Timestamp ();
100- frame.additionalInfo .video .width = encodedImage. _encodedWidth ;
101- frame.additionalInfo .video .height = encodedImage. _encodedHeight ;
104+ frame.additionalInfo .video .width = m_width ;
105+ frame.additionalInfo .video .height = m_height ;
102106 frame.additionalInfo .video .isKeyFrame = (encodedImage._frameType == webrtc::VideoFrameType::kVideoFrameKey );
103107
104108 if (m_parent) {
@@ -113,13 +117,11 @@ int32_t VideoReceiveAdapterImpl::AdapterDecoder::Decode(const webrtc::EncodedIma
113117 m_parent->m_format = format;
114118 statsChanged = true ;
115119 }
116- if (encodedImage._encodedWidth != 0 && encodedImage._encodedHeight != 0 ) {
117- if ((m_parent->m_width != encodedImage._encodedWidth ) || (m_parent->m_height != encodedImage._encodedHeight )) {
118- // Update width and height
119- m_parent->m_width = encodedImage._encodedWidth ;
120- m_parent->m_height = encodedImage._encodedHeight ;
121- statsChanged = true ;
122- }
120+ if ((m_parent->m_width != m_width) || (m_parent->m_height != m_height)) {
121+ // Update width and height
122+ m_parent->m_width = m_width;
123+ m_parent->m_height = m_height;
124+ statsChanged = true ;
123125 }
124126 if (statsChanged) {
125127 // Notify the stats
0 commit comments