64 static void frac_init(AVFrac *f, int64_t
val, int64_t num, int64_t den)
95 }
else if (num >= den) {
109 for (j=2; j<14; j+= 1+(j>2))
110 while (q.
den / q.
num < min_precision && q.
num % j == 0)
112 while (q.
den / q.
num < min_precision && q.
den < (1<<24))
119 const char *format,
const char *filename)
132 av_log(s,
AV_LOG_ERROR,
"Requested output format '%s' is not a suitable output format\n", format);
223 #if FF_API_LAVF_BITEXACT
239 #if FF_API_LAVF_CODEC_TB
243 "timebase hint to the muxer is deprecated. Set "
244 "AVStream.time_base instead.\n");
284 "(%d/%d) and encoder layer (%d/%d)\n",
307 char tagbuf[32], tagbuf2[32];
311 "Tag %s/0x%08x incompatible with output codec id '%d' (%s)\n",
323 "Codec for stream %d does not use global headers "
324 "but container format requires global headers\n", i);
407 if (ret >= 0 && s->
pb && s->
pb->
error < 0)
429 #define AV_PKT_FLAG_UNCODED_FRAME 0x2000
435 #define UNCODED_FRAME_PACKET_SIZE (INT_MIN / 3 * 2 + (int)sizeof(AVFrame))
445 av_dlog(s,
"compute_pkt_fields2: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n",
474 pkt->
pts = st->pts.val;
493 "Application provided invalid, non monotonically increasing dts to muxer in stream %d: %s >= %s\n",
499 "pts (%s) < dts (%s) in stream %d\n",
505 av_dlog(s,
"av_write_frame: pts2:%s dts2:%s\n",
508 st->pts.val = pkt->
dts;
520 if (frame_size >= 0 && (pkt->
size || st->pts.num != st->pts.den >> 1 || st->pts.val)) {
580 "Packets poorly interleaved, failed to avoid negative "
581 "timestamp %s in stream %d.\n"
582 "Try -max_interleave_delta 0 as a possible workaround.\n",
640 if (ret >= 0 && s->
pb && s->
pb->
error < 0)
653 if (ret >= 0 && s->
pb && s->
pb->
error < 0)
661 #define CHUNK_START 0x1000
675 #if FF_API_DESTRUCT_PACKET
710 int64_t syncto =
av_rescale(pkt->
dts + syncoffset, 1, max)*max - syncoffset;
723 && ((chunked && !((*next_point)->pkt.flags&
CHUNK_START))
724 || !compare(s, &(*next_point)->pkt, pkt)))
725 next_point = &(*next_point)->
next;
737 this_pktl->
next = *next_point;
740 *next_point = this_pktl;
760 comp= (ts>ts2) - (ts<ts2);
772 int stream_count = 0;
773 int noninterleaved_count = 0;
787 ++noninterleaved_count;
800 int64_t delta_dts = INT64_MIN;
815 delta_dts =
FFMAX(delta_dts, last_dts - top_dts);
820 "Delay between the first packet and last packet in the "
821 "muxing queue is %"PRId64
" > %"PRId64
": forcing output\n",
827 if (stream_count && flush) {
879 av_dlog(s,
"av_interleaved_write_frame size:%d dts:%s pts:%s\n",
889 av_dlog(s,
"av_interleaved_write_frame FLUSH\n");
897 memset(pkt, 0,
sizeof(*pkt));
967 int64_t *dts, int64_t *wall)
1017 pkt.
data = (
void *)frame;