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

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

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
390390 clear_parity_bits(buf, len);
391391 data = vanc_to_cc(avctx, buf, width, data_len);
392392 if (data) {
393− uint8_t *pkt_cc = av_packet_new_side_data(pkt, AV_PKT_DATA_A53_CC, data_len);
394− if (pkt_cc)
395− memcpy(pkt_cc, data, data_len);
396− av_free(data);
393+ if (av_packet_add_side_data(pkt, AV_PKT_DATA_A53_CC, data, data_len) < 0)
394+ av_free(data);
397395 }
398396 } else {
399397 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