#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
-#include "avcodec.h"
+
#include "bytestream.h"
#include "internal.h"
+#include "packet.h"
void av_init_packet(AVPacket *pkt)
{
case AV_PKT_DATA_ENCRYPTION_INFO: return "Encryption info";
case AV_PKT_DATA_AFD: return "Active Format Description data";
case AV_PKT_DATA_ICC_PROFILE: return "ICC Profile";
+ case AV_PKT_DATA_DOVI_CONF: return "DOVI configuration record";
}
return NULL;
}
int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict)
{
const uint8_t *end;
- int ret = 0;
+ int ret;
if (!dict || !data || !size)
- return ret;
+ return 0;
end = data + size;
if (size && end[-1])
return AVERROR_INVALIDDATA;
ret = av_dict_set(dict, key, val, 0);
if (ret < 0)
- break;
+ return ret;
data = val + strlen(val) + 1;
}
- return ret;
+ return 0;
}
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
{
int ret;
+ dst->buf = NULL;
+
ret = av_packet_copy_props(dst, src);
if (ret < 0)
- return ret;
+ goto fail;
if (!src->buf) {
- dst->buf = NULL;
ret = packet_alloc(&dst->buf, src->size);
if (ret < 0)
goto fail;
return 0;
fail:
- av_packet_free_side_data(dst);
+ av_packet_unref(dst);
return ret;
}