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

Function sap_write_packet

libavformat/sapenc.c:255–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255static int sap_write_packet(AVFormatContext *s, AVPacket *pkt)
256{
257 AVFormatContext *rtpctx;
258 struct SAPState *sap = s->priv_data;
259 int64_t now = av_gettime_relative();
260
261 if (!sap->last_time || now - sap->last_time > 5000000) {
262 int ret = ffurl_write(sap->ann_fd, sap->ann, sap->ann_size);
263 /* Don't abort even if we get "Destination unreachable" */
264 if (ret < 0 && ret != AVERROR(ECONNREFUSED))
265 return ret;
266 sap->last_time = now;
267 }
268 rtpctx = s->streams[pkt->stream_index]->priv_data;
269 return ff_write_chained(rtpctx, 0, pkt, s, 0);
270}
271
272const FFOutputFormat ff_sap_muxer = {
273 .p.name = "sap",

Callers

nothing calls this directly

Calls 3

av_gettime_relativeFunction · 0.85
ffurl_writeFunction · 0.85
ff_write_chainedFunction · 0.85

Tested by

no test coverage detected