Skip to content

Commit

Permalink
Merge pull request #1781 from jasaw/ffmpeg-omx-endofframe-fix
Browse files Browse the repository at this point in the history
ffmpeg: fix omx code not checking endofframe flag
  • Loading branch information
ccrisan authored Jan 17, 2019
2 parents 0405657 + b80aedf commit dc64161
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions package/ffmpeg/omx-handle-endofframe.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Addresses https://github.com/raspberrypi/firmware/issues/1087
---

diff -rupEbBN ffmpeg-3.4.4.org/libavcodec/omx.c ffmpeg-3.4.4/libavcodec/omx.c
--- ffmpeg-3.4.4.org/libavcodec/omx.c 2019-01-17 15:08:50.141300045 +1100
+++ ffmpeg-3.4.4/libavcodec/omx.c 2019-01-17 16:07:12.337292988 +1100
@@ -735,6 +735,7 @@ static int omx_encode_frame(AVCodecConte
int ret = 0;
OMX_BUFFERHEADERTYPE* buffer;
OMX_ERRORTYPE err;
+ int had_partial = 0;

if (frame) {
uint8_t *dst[4];
@@ -826,7 +827,7 @@ static int omx_encode_frame(AVCodecConte
// packet, or get EOS.
buffer = get_buffer(&s->output_mutex, &s->output_cond,
&s->num_done_out_buffers, s->done_out_buffers,
- !frame);
+ !frame || had_partial);
if (!buffer)
break;

@@ -861,6 +862,7 @@ static int omx_encode_frame(AVCodecConte
s->output_buf = NULL;
s->output_buf_size = 0;
}
+ had_partial = 1;
} 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) {

0 comments on commit dc64161

Please sign in to comment.