diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-04-29 23:33:41 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-06-08 12:52:49 +0200 |
commit | eeedc8817a8d7c1264fc952ffdbba501be3c679e (patch) | |
tree | 77baf62617cd61fa1469472ed232c86562d0e9f5 | |
parent | 835d8b7401466c2c22d4f439c3c331eb949d793e (diff) | |
download | ffmpeg-eeedc8817a8d7c1264fc952ffdbba501be3c679e.tar.gz |
avcodec/omx: Remove remnants of old preallocated buffers
There are no preallocated buffer packets any more; this feature only
worked with the old encode API and only until said API was turned into
a wrapper for the new API in 93016f5d1d280f9cb7856883af287fa66affc04c.
So remove its remnants.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/omx.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/libavcodec/omx.c b/libavcodec/omx.c index 3a113723d3..1e48579d4b 100644 --- a/libavcodec/omx.c +++ b/libavcodec/omx.c @@ -863,9 +863,6 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, avctx->extradata_size += buffer->nFilledLen; memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); } else { - if (!(buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) || !pkt->data) { - // If the output packet isn't preallocated, just concatenate everything in our - // own buffer int newsize = s->output_buf_size + buffer->nFilledLen + AV_INPUT_BUFFER_PADDING_SIZE; if ((ret = av_reallocp(&s->output_buf, newsize)) < 0) { s->output_buf_size = 0; @@ -885,18 +882,6 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, #if CONFIG_OMX_RPI had_partial = 1; #endif - } else { - // End of frame, and the caller provided a preallocated frame - if ((ret = ff_alloc_packet2(avctx, pkt, s->output_buf_size + buffer->nFilledLen, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size %d.\n", - (int)(s->output_buf_size + buffer->nFilledLen)); - goto end; - } - memcpy(pkt->data, s->output_buf, s->output_buf_size); - memcpy(pkt->data + s->output_buf_size, buffer->pBuffer + buffer->nOffset, buffer->nFilledLen); - av_freep(&s->output_buf); - s->output_buf_size = 0; - } if (buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) { pkt->pts = av_rescale_q(from_omx_ticks(buffer->nTimeStamp), AV_TIME_BASE_Q, avctx->time_base); // We don't currently enable B-frames for the encoders, so set |