| 248 | } |
| 249 | |
| 250 | static int sync_queue_process(Muxer *mux, MuxStream *ms, AVPacket *pkt, int *stream_eof) |
| 251 | { |
| 252 | OutputFile *of = &mux->of; |
| 253 | |
| 254 | if (ms->sq_idx_mux >= 0) { |
| 255 | int ret = sq_send(mux->sq_mux, ms->sq_idx_mux, SQPKT(pkt)); |
| 256 | if (ret < 0) { |
| 257 | if (ret == AVERROR_EOF) |
| 258 | *stream_eof = 1; |
| 259 | |
| 260 | return ret; |
| 261 | } |
| 262 | |
| 263 | while (1) { |
| 264 | ret = sq_receive(mux->sq_mux, -1, SQPKT(mux->sq_pkt)); |
| 265 | if (ret < 0) { |
| 266 | /* n.b.: We forward EOF from the sync queue, terminating muxing. |
| 267 | * This assumes that if a muxing sync queue is present, then all |
| 268 | * the streams use it. That is true currently, but may change in |
| 269 | * the future, then this code needs to be revisited. |
| 270 | */ |
| 271 | return ret == AVERROR(EAGAIN) ? 0 : ret; |
| 272 | } |
| 273 | |
| 274 | ret = write_packet(mux, of->streams[ret], |
| 275 | mux->sq_pkt); |
| 276 | if (ret < 0) |
| 277 | return ret; |
| 278 | } |
| 279 | } else if (pkt) |
| 280 | return write_packet(mux, &ms->ost, pkt); |
| 281 | |
| 282 | return 0; |
| 283 | } |
| 284 | |
| 285 | static int of_streamcopy(OutputFile *of, OutputStream *ost, AVPacket *pkt); |
| 286 |
no test coverage detected