comparison 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
comparison
equal deleted inserted replaced
6023:d679feb6ead1 6024:ee42a04b24f2
3589 vsnprintf(str + len, size > len ? size - len : 0, fmt, vl); 3589 vsnprintf(str + len, size > len ? size - len : 0, fmt, vl);
3590 va_end(vl); 3590 va_end(vl);
3591 } 3591 }
3592 return strlen(str); 3592 return strlen(str);
3593 } 3593 }
3594
3595 int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
3596 AVFormatContext *src)
3597 {
3598 AVPacket local_pkt;
3599
3600 local_pkt = *pkt;
3601 local_pkt.stream_index = dst_stream;
3602 if (pkt->pts != AV_NOPTS_VALUE)
3603 local_pkt.pts = av_rescale_q(pkt->pts,
3604 src->streams[pkt->stream_index]->time_base,
3605 dst->streams[dst_stream]->time_base);
3606 if (pkt->dts != AV_NOPTS_VALUE)
3607 local_pkt.dts = av_rescale_q(pkt->dts,
3608 src->streams[pkt->stream_index]->time_base,
3609 dst->streams[dst_stream]->time_base);
3610 return av_write_frame(dst, &local_pkt);
3611 }
3612