| 1335 | } |
| 1336 | |
| 1337 | int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt, |
| 1338 | AVFormatContext *src, int interleave) |
| 1339 | { |
| 1340 | int64_t pts = pkt->pts, dts = pkt->dts, duration = pkt->duration; |
| 1341 | int stream_index = pkt->stream_index; |
| 1342 | AVRational time_base = pkt->time_base; |
| 1343 | int ret; |
| 1344 | |
| 1345 | pkt->stream_index = dst_stream; |
| 1346 | |
| 1347 | av_packet_rescale_ts(pkt, |
| 1348 | src->streams[stream_index]->time_base, |
| 1349 | dst->streams[dst_stream]->time_base); |
| 1350 | |
| 1351 | if (!interleave) { |
| 1352 | ret = av_write_frame(dst, pkt); |
| 1353 | /* We only have to backup and restore the fields that |
| 1354 | * we changed ourselves, because av_write_frame() does not |
| 1355 | * modify the packet given to it. */ |
| 1356 | pkt->pts = pts; |
| 1357 | pkt->dts = dts; |
| 1358 | pkt->duration = duration; |
| 1359 | pkt->stream_index = stream_index; |
| 1360 | pkt->time_base = time_base; |
| 1361 | } else |
| 1362 | ret = av_interleaved_write_frame(dst, pkt); |
| 1363 | |
| 1364 | return ret; |
| 1365 | } |
| 1366 | |
| 1367 | static void uncoded_frame_free(void *unused, uint8_t *data) |
| 1368 | { |
no test coverage detected