This is done so that its data is really owned by the packet.
This was already true for the current callers.
Signed-off-by: James Almer <jamrial@gmail.com>
*
* @param head List head element
* @param tail List tail element
- * @param pkt The packet being appended
+ * @param pkt The packet being appended. The data described in it will
+ * be made reference counted if it isn't already.
* @param flags Any combination of FF_PACKETLIST_FLAG_* flags
* @return 0 on success, negative AVERROR value on failure. On failure,
the list is unchanged
return ret;
}
} else {
+ ret = av_packet_make_refcounted(pkt);
+ if (ret < 0) {
+ av_free(pktl);
+ return ret;
+ }
av_packet_move_ref(&pktl->pkt, pkt);
}