aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-06-16 23:58:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-06-16 23:58:59 +0200
commit8097307bfb6a90d18d35a870ff61016111820ab7 (patch)
tree1ebbdf511c4541ab5a55cff43cbb3ddd4a6b04f2 /libavformat/mux.c
parentbbdef61850205f5af1a0a292fb7166c92726e93b (diff)
parent12db891dcd57b305d6e3c1e22ea8204dc26edda1 (diff)
downloadffmpeg-8097307bfb6a90d18d35a870ff61016111820ab7.tar.gz
Merge commit '12db891dcd57b305d6e3c1e22ea8204dc26edda1'
* commit '12db891dcd57b305d6e3c1e22ea8204dc26edda1': avf: move ff_write_chained to mux.c Conflicts: libavformat/mux.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 9b4b0b1249..34c9328c33 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -836,3 +836,25 @@ int av_get_output_timestamp(struct AVFormatContext *s, int stream,
s->oformat->get_output_timestamp(s, stream, dts, wall);
return 0;
}
+
+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);
+ if (pkt->duration)
+ local_pkt.duration = av_rescale_q(pkt->duration,
+ src->streams[pkt->stream_index]->time_base,
+ dst->streams[dst_stream]->time_base);
+ return av_write_frame(dst, &local_pkt);
+}