summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-15 11:56:36 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-06-16 14:41:07 +0200
commit12db891dcd57b305d6e3c1e22ea8204dc26edda1 (patch)
tree7991c55f2892214f0672db279dcf7a680fd52704 /libavformat/mux.c
parent508998f7d5cc61c7ac7b049813b47adc24c6e282 (diff)
avf: move ff_write_chained to mux.c
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index b51f906c4f..96193dd9a6 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -621,3 +621,21 @@ fail:
av_freep(&s->priv_data);
return ret;
}
+
+int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
+ AVFormatContext *src)
+{
+ AVPacket local_pkt;
+
+ local_pkt = *pkt;
+ local_pkt.stream_index = dst_stream;
+ if (pkt->pts != AV_NOPTS_VALUE)
+ local_pkt.pts = av_rescale_q(pkt->pts,
+ src->streams[pkt->stream_index]->time_base,
+ dst->streams[dst_stream]->time_base);
+ if (pkt->dts != AV_NOPTS_VALUE)
+ local_pkt.dts = av_rescale_q(pkt->dts,
+ src->streams[pkt->stream_index]->time_base,
+ dst->streams[dst_stream]->time_base);
+ return av_write_frame(dst, &local_pkt);
+}