Mercurial > libavformat.hg
diff utils.c @ 6024:ee42a04b24f2 libavformat
Add a libavformat internal function ff_write_chained
author | mstorsjo |
---|---|
date | Fri, 21 May 2010 07:07:57 +0000 |
parents | 2e702728eea8 |
children | 44d635df3f26 |
line wrap: on
line diff
--- a/utils.c Thu May 20 18:34:44 2010 +0000 +++ b/utils.c Fri May 21 07:07:57 2010 +0000 @@ -3591,3 +3591,22 @@ } return strlen(str); } + +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); +} +