File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1717// ///////////////////////////////////////////////////////////////////////////////////////////////
1818
1919#pragma once
20+
21+ // clang-format off
22+ #include < stdint.h>
2023#include < native_vsync/native_vsync.h>
21- # include < cstdint >
24+ // clang-format on
2225#include < functional>
2326#include < mutex>
2427#include " rendering/utils/DisplayLink.h"
Original file line number Diff line number Diff line change @@ -208,7 +208,6 @@ DecodingResult OHOSVideoDecoder::onDecodeFrame() {
208208 codecBufferInfo = codecUserData->outputBufferInfoQueue .front ();
209209 codecUserData->outputBufferInfoQueue .pop ();
210210 lock.unlock ();
211- lastOutputBufferIndex = codecBufferInfo.bufferIndex ;
212211 pendingFrames.remove (codecBufferInfo.attr .pts );
213212 if (codecBufferInfo.buffer == nullptr ) {
214213 return DecodingResult::Error;
@@ -230,7 +229,6 @@ void OHOSVideoDecoder::onFlush() {
230229 }
231230 codecUserData->clearQueue ();
232231 pendingFrames.clear ();
233- lastOutputBufferIndex = -1 ;
234232 codecBufferInfo = {0 , nullptr };
235233 start ();
236234}
@@ -309,12 +307,12 @@ std::shared_ptr<tgfx::ImageBuffer> OHOSVideoDecoder::onRenderFrame() {
309307}
310308
311309void OHOSVideoDecoder::releaseOutputBuffer () {
312- if (lastOutputBufferIndex != - 1 ) {
310+ if (codecBufferInfo. buffer ) {
313311 int ret = OH_VideoDecoder_FreeOutputBuffer (videoCodec, codecBufferInfo.bufferIndex );
314312 if (ret != AV_ERR_OK) {
315313 LOGE (" OH_VideoDecoder_FreeOutputBuffer failed, ret:%d" , ret);
316314 }
317- lastOutputBufferIndex = - 1 ;
315+ codecBufferInfo = { 0 , nullptr } ;
318316 }
319317}
320318
Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ class OHOSVideoDecoder : public VideoDecoder {
9797 int64_t yBufferSize = 0 ;
9898 int64_t uvBufferSize = 0 ;
9999 std::weak_ptr<OHOSVideoDecoder> weakThis;
100- int lastOutputBufferIndex = -1 ;
101100
102101 explicit OHOSVideoDecoder (const VideoFormat& format, bool hardware);
103102 bool initDecoder (const OH_AVCodecCategory avCodecCategory);
You can’t perform that action at this time.
0 commit comments