MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_packet_make_writable

Function av_packet_make_writable

libavcodec/packet.c:514–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514int av_packet_make_writable(AVPacket *pkt)
515{
516 AVBufferRef *buf = NULL;
517 int ret;
518
519 if (pkt->buf && av_buffer_is_writable(pkt->buf))
520 return 0;
521
522 ret = packet_alloc(&buf, pkt->size);
523 if (ret < 0)
524 return ret;
525 av_assert1(!pkt->size || pkt->data);
526 if (pkt->size)
527 memcpy(buf->data, pkt->data, pkt->size);
528
529 av_buffer_unref(&pkt->buf);
530 pkt->buf = buf;
531 pkt->data = buf->data;
532
533 return 0;
534}
535
536void av_packet_rescale_ts(AVPacket *pkt, AVRational src_tb, AVRational dst_tb)
537{

Callers 9

mov_write_packetFunction · 0.85
decode_frameFunction · 0.85
imm5_decode_frameFunction · 0.85
ftr_decode_frameFunction · 0.85
truehd_core_filterFunction · 0.85
prores_metadataFunction · 0.85
dv_error_marker_filterFunction · 0.85
noiseFunction · 0.85

Calls 3

av_buffer_is_writableFunction · 0.85
packet_allocFunction · 0.85
av_buffer_unrefFunction · 0.85

Tested by

no test coverage detected