Commit 2b61cc44 authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit 'a9b8c638'

* commit 'a9b8c638':
  mmal: Fix AVBufferRef usage
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents f3310df8 a9b8c638
......@@ -433,17 +433,20 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt,
if (avpkt->size) {
if (avpkt->buf) {
buf = av_buffer_ref(avpkt->buf);
size = avpkt->size;
data = avpkt->data;
} else {
buf = av_buffer_alloc(avpkt->size);
if (buf)
if (buf) {
memcpy(buf->data, avpkt->data, avpkt->size);
size = buf->size;
data = buf->data;
}
}
if (!buf) {
ret = AVERROR(ENOMEM);
goto done;
}
size = buf->size;
data = buf->data;
if (!is_extradata)
ctx->packets_sent++;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment