Make sure the next frame to be decoded is cleaned up if it's empty.
BUG= TEST= Review URL: http://webrtc-codereview.appspot.com/332001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1261 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
		| @@ -1752,15 +1752,15 @@ VCMJitterBuffer::RecycleFramesUntilKeyFrame() | ||||
|  | ||||
| // Must be called under the critical section _critSect. | ||||
| void VCMJitterBuffer::CleanUpOldFrames() { | ||||
|   if (_lastDecodedState.init()) | ||||
|     return; | ||||
|  | ||||
|   VCMFrameListItem* oldestFrameListItem = _frameBuffersTSOrder.First(); | ||||
|   VCMFrameBuffer* oldestFrame = NULL; | ||||
|  | ||||
|   while (oldestFrameListItem != NULL) { | ||||
|     oldestFrame = oldestFrameListItem->GetItem(); | ||||
|     if (_lastDecodedState.IsOldFrame(oldestFrame)) { | ||||
|     bool nextFrameEmpty = (_lastDecodedState.ContinuousFrame(oldestFrame) && | ||||
|         oldestFrame->GetState() == kStateEmpty); | ||||
|     if (_lastDecodedState.IsOldFrame(oldestFrame) || (nextFrameEmpty && | ||||
|         _frameBuffersTSOrder.Next(oldestFrameListItem) != NULL)) { | ||||
|       _frameBuffersTSOrder.Erase(oldestFrameListItem); | ||||
|       ReleaseFrameInternal(oldestFrame); | ||||
|       oldestFrameListItem = _frameBuffersTSOrder.First(); | ||||
|   | ||||
| @@ -1884,8 +1884,6 @@ int JitterBufferTest(CmdArgs& args) | ||||
|     // Insert the packet -> frame recycled | ||||
|     TEST(kSizeError == jb.InsertPacket(frameIn, packet)); | ||||
|  | ||||
|     // should fail | ||||
|     TEST(-1 == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); | ||||
|     TEST(0 == jb.GetCompleteFrameForDecoding(10)); | ||||
|  | ||||
|     //printf("DONE fill frame - packets > max number of packets\n"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 stefan@webrtc.org
					stefan@webrtc.org