return AVERROR(ENOMEM);
}
-static inline void put_timestamp(ByteIOContext *pb, int id, int64_t timestamp)
+void ff_mpeg_put_ts(ByteIOContext *pb, int id, int64_t timestamp)
{
put_byte(pb,
(id << 4) |
put_byte(&ctx->pb, header_len - 3 + stuffing_size);
if (pes_flags & 0x80) /*write pts*/
- put_timestamp(&ctx->pb, (pes_flags & 0x40) ? 0x03 : 0x02, pts);
+ ff_mpeg_put_ts(&ctx->pb, (pes_flags & 0x40) ? 0x03 : 0x02, pts);
if (pes_flags & 0x40) /*write dts*/
- put_timestamp(&ctx->pb, 0x01, dts);
+ ff_mpeg_put_ts(&ctx->pb, 0x01, dts);
if (pes_flags & 0x01) { /*write pes extension*/
put_byte(&ctx->pb, 0x10); /* flags */
} else {
if (pts != AV_NOPTS_VALUE) {
if (dts != pts) {
- put_timestamp(&ctx->pb, 0x03, pts);
- put_timestamp(&ctx->pb, 0x01, dts);
+ ff_mpeg_put_ts(&ctx->pb, 0x03, pts);
+ ff_mpeg_put_ts(&ctx->pb, 0x01, dts);
} else {
- put_timestamp(&ctx->pb, 0x02, pts);
+ ff_mpeg_put_ts(&ctx->pb, 0x02, pts);
}
} else {
put_byte(&ctx->pb, 0x0f);