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

Function update_offset

libavformat/rtmpproto.c:2272–2294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2270}
2271
2272static int update_offset(RTMPContext *rt, int size)
2273{
2274 int old_flv_size;
2275
2276 if (size < 0)
2277 return AVERROR(EINVAL);
2278
2279 // generate packet header and put data into buffer for FLV demuxer
2280 if (rt->flv_off < rt->flv_size) {
2281 // There is old unread data in the buffer, thus append at the end
2282 if (rt->flv_size > INT_MAX - size)
2283 return AVERROR(ERANGE);
2284 old_flv_size = rt->flv_size;
2285 rt->flv_size += size;
2286 } else {
2287 // All data has been read, write the new data at the start of the buffer
2288 old_flv_size = 0;
2289 rt->flv_size = size;
2290 rt->flv_off = 0;
2291 }
2292
2293 return old_flv_size;
2294}
2295
2296static int append_flv_data(RTMPContext *rt, RTMPPacket *pkt, int skip)
2297{

Callers 2

append_flv_dataFunction · 0.85
handle_metadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected