67 static void frac_init(AVFrac *f, int64_t
val, int64_t num, int64_t den)
98 }
else if (num >= den) {
112 for (j=2; j<14; j+= 1+(j>2))
113 while (q.
den / q.
num < min_precision && q.
num % j == 0)
115 while (q.
den / q.
num < min_precision && q.
den < (1<<24))
122 const char *format,
const char *filename)
135 av_log(s,
AV_LOG_ERROR,
"Requested output format '%s' is not a suitable output format\n", format);
174 #if FF_API_ALLOC_OUTPUT_CONTEXT
180 return ret < 0 ? NULL : avctx;
236 #if FF_API_LAVF_BITEXACT
252 #if FF_API_LAVF_CODEC_TB
256 "timebase hint to the muxer is deprecated. Set "
257 "AVStream.time_base instead.\n");
297 "(%d/%d) and encoder layer (%d/%d)\n",
320 char tagbuf[32], tagbuf2[32];
324 "Tag %s/0x%08x incompatible with output codec id '%d' (%s)\n",
336 "Codec for stream %d does not use global headers "
337 "but container format requires global headers\n", i);
420 if (ret >= 0 && s->
pb && s->
pb->
error < 0)
441 #define AV_PKT_FLAG_UNCODED_FRAME 0x2000
447 #define UNCODED_FRAME_PACKET_SIZE (INT_MIN / 3 * 2 + (int)sizeof(AVFrame))
457 av_dlog(s,
"compute_pkt_fields2: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n",
486 pkt->
pts = st->pts.val;
504 "Application provided invalid, non monotonically increasing dts to muxer in stream %d: %s >= %s\n",
514 av_dlog(s,
"av_write_frame: pts2:%s dts2:%s\n",
517 st->pts.val = pkt->
dts;
529 if (frame_size >= 0 && (pkt->
size || st->pts.num != st->pts.den >> 1 || st->pts.val)) {
572 if (s->
offset && !offset) {
639 if (ret >= 0 && s->
pb && s->
pb->
error < 0)
652 if (ret >= 0 && s->
pb && s->
pb->
error < 0)
660 #define CHUNK_START 0x1000
674 #if FF_API_DESTRUCT_PACKET
709 int64_t syncto =
av_rescale(pkt->
dts + syncoffset, 1, max)*max - syncoffset;
722 && ((chunked && !((*next_point)->pkt.flags&
CHUNK_START))
723 || !compare(s, &(*next_point)->pkt, pkt)))
724 next_point = &(*next_point)->
next;
736 this_pktl->
next = *next_point;
739 *next_point = this_pktl;
759 comp= (ts>ts2) - (ts<ts2);
771 int stream_count = 0;
772 int noninterleaved_count = 0;
786 ++noninterleaved_count;
799 int64_t delta_dts = INT64_MIN;
814 delta_dts =
FFMAX(delta_dts, last_dts - top_dts);
819 "Delay between the first packet and last packet in the "
820 "muxing queue is %"PRId64
" > %"PRId64
": forcing output\n",
826 if (stream_count && flush) {
878 av_dlog(s,
"av_interleaved_write_frame size:%d dts:%s pts:%s\n",
888 av_dlog(s,
"av_interleaved_write_frame FLUSH\n");
896 memset(pkt, 0,
sizeof(*pkt));
962 int64_t *dts, int64_t *wall)
1012 pkt.
data = (
void *)frame;