C2SoftOpusEnc: fix misplaced output timestamp computation
During a process call, at the start of the loop, the current frame pts is computed. At the end of the loop, if there are no more samples to be processed, then the work item is filled and returned. If there are more samples to be processed, this timestamp is marked as previous output pts and used during cloneAndSend() and the current output pts is updated. The problem occurs, if there are more samples to be processed but not enough to generate an output. In this case output pts need not be updated. The previously generated timestamp should be used to signal the output and mark the work item as done. This is addressed by deferring the output pts computation only when an output is generated. Minor code cleanup. Bug: 412479079 Bug: 139484367 Test: atest MctsMediaV2TestCases -- --module-arg \ MctsMediaV2TestCases:instrumentation-arg:media-type-sel:=opus Test: atest MctsMediaEncoderTestCases -- --module-arg \ MctsMediaEncoderTestCases:instrumentation-arg:media-type-prefix:=audio/opus Test: atest VtsHalMediaC2V1_0TargetAudioEncTest Flag: EXEMPT bugfix Change-Id: I42162b42587927aed727da6a9eb790835105d221
Loading
Please register or sign in to comment