mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
avdevice/decklink_dec: use av_packet_add_side_data()
It uses the existing buffer instead of allocating a new one. Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
a22c6a4796
commit
0c1ffd0aa5
@ -390,10 +390,8 @@ uint8_t *get_metadata(AVFormatContext *avctx, uint16_t *buf, size_t width,
|
||||
clear_parity_bits(buf, len);
|
||||
data = vanc_to_cc(avctx, buf, width, data_len);
|
||||
if (data) {
|
||||
uint8_t *pkt_cc = av_packet_new_side_data(pkt, AV_PKT_DATA_A53_CC, data_len);
|
||||
if (pkt_cc)
|
||||
memcpy(pkt_cc, data, data_len);
|
||||
av_free(data);
|
||||
if (av_packet_add_side_data(pkt, AV_PKT_DATA_A53_CC, data, data_len) < 0)
|
||||
av_free(data);
|
||||
}
|
||||
} else {
|
||||
av_log(avctx, AV_LOG_DEBUG, "Unknown meta data DID = 0x%.2x SDID = 0x%.2x\n",
|
||||
|
Loading…
Reference in New Issue
Block a user