| 253 | } |
| 254 | |
| 255 | static 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 | |
| 272 | const FFOutputFormat ff_sap_muxer = { |
| 273 | .p.name = "sap", |
nothing calls this directly
no test coverage detected