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

Function av_packet_unpack_dictionary

libavcodec/packet.c:352–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352int av_packet_unpack_dictionary(const uint8_t *data, size_t size,
353 AVDictionary **dict)
354{
355 const uint8_t *end;
356 int ret;
357
358 if (!dict || !data || !size)
359 return 0;
360 end = data + size;
361 if (size && end[-1])
362 return AVERROR_INVALIDDATA;
363 while (data < end) {
364 const uint8_t *key = data;
365 const uint8_t *val = data + strlen(key) + 1;
366
367 if (val >= end || !*key)
368 return AVERROR_INVALIDDATA;
369
370 ret = av_dict_set(dict, key, val, 0);
371 if (ret < 0)
372 return ret;
373 data = val + strlen(val) + 1;
374 }
375
376 return 0;
377}
378
379int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
380 size_t size)

Callers 4

ff_decklink_read_packetFunction · 0.85
ogg_check_new_metadataFunction · 0.85
show_packetFunction · 0.85

Calls 1

av_dict_setFunction · 0.85

Tested by

no test coverage detected