History

avdevice/decklink_dec: use av_packet_add_side_data()

It uses the existing buffer instead of allocating a new one.

James Almer committed 9 years ago

Commit 0c1ffd01 parent a22c6a41 file · +2 −4Browse files

Unified · Split

libavdevice/decklink_dec.cpp+2−4
@@ -390,10 +390,8 @@ uint8_t *get_metadata(AVFormatContext *avctx, uint16_t *buf, size_t width, · 389 unmodified lines
390 clear_parity_bits(buf, len);390 clear_parity_bits(buf, len);
391 data = vanc_to_cc(avctx, buf, width, data_len);391 data = vanc_to_cc(avctx, buf, width, data_len);
392 if (data) {392 if (data) {
393 uint8_t *pkt_cc = av_packet_new_side_data(pkt, AV_PKT_DATA_A53_CC, data_len);393 if (av_packet_add_side_data(pkt, AV_PKT_DATA_A53_CC, data, data_len) < 0)
394 if (pkt_cc)394 av_free(data);
395 memcpy(pkt_cc, data, data_len);
396 av_free(data);
397 }395 }
398 } else {396 } else {
399 av_log(avctx, AV_LOG_DEBUG, "Unknown meta data DID = 0x%.2x SDID = 0x%.2x\n",397 av_log(avctx, AV_LOG_DEBUG, "Unknown meta data DID = 0x%.2x SDID = 0x%.2x\n",

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