History

libavdevice/decklink: configurablity to set max queue size

Ravindra committed 9 years ago

Commit f3913dc1 parent 6f03ffb6 files · +17 −3Browse files

Showing the changes to libavdevice/decklink_dec.cpp (1 of 6 files). Show all

Unified · Split

libavdevice/decklink_dec.cpp+5−2
@@ -1,6 +1,7 @@
11 /*
22 * Blackmagic DeckLink input
33 * Copyright (c) 2013-2014 Luca Barbato, Deti Fliegl
4+ * Copyright (c) 2017 Akamai Technologies, Inc.
45 *
56 * This file is part of FFmpeg.
67 *
@@ -187,10 +188,12 @@ static uint8_t* teletext_data_unit_from_vanc_data(uint8_t *src, uint8_t *tgt, in · 180 unmodified lines
187188
188189 static void avpacket_queue_init(AVFormatContext *avctx, AVPacketQueue *q)
189190 {
191+ struct decklink_cctx *ctx = (struct decklink_cctx *)avctx->priv_data;
190192 memset(q, 0, sizeof(AVPacketQueue));
191193 pthread_mutex_init(&q->mutex, NULL);
192194 pthread_cond_init(&q->cond, NULL);
193195 q->avctx = avctx;
196+ q->max_q_size = ctx->queue_size;
194197 }
195198
196199 static void avpacket_queue_flush(AVPacketQueue *q)
@@ -230,8 +233,8 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) · 33 unmodified lines
230233 {
231234 AVPacketList *pkt1;
232235
233− // Drop Packet if queue size is > 1GB
234− if (avpacket_queue_size(q) > 1024 * 1024 * 1024 ) {
236+ // Drop Packet if queue size is > maximum queue size
237+ if (avpacket_queue_size(q) > q->max_q_size) {
235238 av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");
236239 return -1;
237240 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t