Commit e91f0c4f authored by James Almer's avatar James Almer

avdevice/decklink_dec: remove av_dup_packet() usage

Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 0c1ffd0a
...@@ -450,22 +450,24 @@ static unsigned long long avpacket_queue_size(AVPacketQueue *q) ...@@ -450,22 +450,24 @@ static unsigned long long avpacket_queue_size(AVPacketQueue *q)
static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt)
{ {
AVPacketList *pkt1; AVPacketList *pkt1;
int ret;
// Drop Packet if queue size is > maximum queue size // Drop Packet if queue size is > maximum queue size
if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) { if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) {
av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n"); av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");
return -1; return -1;
} }
/* duplicate the packet */
if (av_dup_packet(pkt) < 0) {
return -1;
}
pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList)); pkt1 = (AVPacketList *)av_mallocz(sizeof(AVPacketList));
if (!pkt1) { if (!pkt1) {
return -1; return -1;
} }
pkt1->pkt = *pkt; ret = av_packet_ref(&pkt1->pkt, pkt);
av_packet_unref(pkt);
if (ret < 0) {
av_free(pkt1);
return -1;
}
pkt1->next = NULL; pkt1->next = NULL;
pthread_mutex_lock(&q->mutex); pthread_mutex_lock(&q->mutex);
......
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