omx: Don't return > 0 from omx_encode_frame

Message ID 1466720041-41902-1-git-send-email-martin@martin.st
State Committed
Commit 0c9c4004ed57de210b4d83c7b39bbfb00b86b9af
Headers show

Commit Message

Martin Storsjö June 23, 2016, 10:14 p.m.
The encode function is supposed to just return 0 on success.
This stems from a mixup with the return value of decode functions.
---
 libavcodec/omx.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Luca Barbato June 24, 2016, 9:49 a.m. | #1
On 24/06/16 00:14, Martin Storsjö wrote:
> The encode function is supposed to just return 0 on success.
> This stems from a mixup with the return value of decode functions.
> ---
>  libavcodec/omx.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libavcodec/omx.c b/libavcodec/omx.c
> index 63c7f5b..0c61c2f 100644
> --- a/libavcodec/omx.c
> +++ b/libavcodec/omx.c
> @@ -845,7 +845,6 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>                  s->output_buf_size = 0;
>              }
>              if (buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) {
> -                ret = pkt->size;
>                  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
>                  // pkt->dts = pkt->pts. (The calling code behaves worse if the encoder
> 

Ok.

Patch

diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index 63c7f5b..0c61c2f 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -845,7 +845,6 @@  static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                 s->output_buf_size = 0;
             }
             if (buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) {
-                ret = pkt->size;
                 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
                 // pkt->dts = pkt->pts. (The calling code behaves worse if the encoder