[FFmpeg-cvslog] avcodec/mediacodecenc: Remove write only variable
Zhao Zhili
git at videolan.org
Tue Apr 23 11:09:31 EEST 2024
ffmpeg | branch: master | Zhao Zhili <zhilizhao at tencent.com> | Wed Apr 17 12:37:39 2024 +0800| [3cfea6993ac5185543d0d1142e93d6f96baee3c0] | committer: Zhao Zhili
avcodec/mediacodecenc: Remove write only variable
Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3cfea6993ac5185543d0d1142e93d6f96baee3c0
---
libavcodec/mediacodecenc.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index e562181120..8caaad729a 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -352,9 +352,7 @@ bailout:
return ret;
}
-static int mediacodec_receive(AVCodecContext *avctx,
- AVPacket *pkt,
- int *got_packet)
+static int mediacodec_receive(AVCodecContext *avctx, AVPacket *pkt)
{
MediaCodecEncContext *s = avctx->priv_data;
FFAMediaCodec *codec = s->codec;
@@ -400,7 +398,7 @@ static int mediacodec_receive(AVCodecContext *avctx,
memcpy(s->extradata, out_buf + out_info.offset, out_info.size);
ff_AMediaCodec_releaseOutputBuffer(codec, index, false);
// try immediately
- return mediacodec_receive(avctx, pkt, got_packet);
+ return mediacodec_receive(avctx, pkt);
}
ret = ff_get_encode_buffer(avctx, pkt, out_info.size + s->extradata_size, 0);
@@ -419,7 +417,6 @@ static int mediacodec_receive(AVCodecContext *avctx,
if (out_info.flags & ff_AMediaCodec_getBufferFlagKeyFrame(codec))
pkt->flags |= AV_PKT_FLAG_KEY;
ret = 0;
- *got_packet = 1;
av_log(avctx, AV_LOG_TRACE, "receive packet pts %" PRId64 " dts %" PRId64
" flags %d extradata %d\n",
@@ -510,7 +507,6 @@ static int mediacodec_encode(AVCodecContext *avctx, AVPacket *pkt)
{
MediaCodecEncContext *s = avctx->priv_data;
int ret;
- int got_packet = 0;
// Return on three case:
// 1. Serious error
@@ -525,7 +521,7 @@ static int mediacodec_encode(AVCodecContext *avctx, AVPacket *pkt)
return ret;
}
- ret = mediacodec_receive(avctx, pkt, &got_packet);
+ ret = mediacodec_receive(avctx, pkt);
if (s->bsf) {
if (!ret || ret == AVERROR_EOF)
ret = av_bsf_send_packet(s->bsf, pkt);
More information about the ffmpeg-cvslog
mailing list