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)
439 #define AV_PKT_FLAG_UNCODED_FRAME 0x2000
445 #define UNCODED_FRAME_PACKET_SIZE (INT_MIN / 3 * 2 + (int)sizeof(AVFrame))
455 av_dlog(s,
"compute_pkt_fields2: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n",
484 pkt->
pts = st->pts.val;
502 "Application provided invalid, non monotonically increasing dts to muxer in stream %d: %s >= %s\n",
512 av_dlog(s,
"av_write_frame: pts2:%s dts2:%s\n",
515 st->pts.val = pkt->
dts;
527 if (frame_size >= 0 && (pkt->
size || st->pts.num != st->pts.den >> 1 || st->pts.val)) {
570 if (s->
offset && !offset) {
637 if (ret >= 0 && s->
pb && s->
pb->
error < 0)
650 if (ret >= 0 && s->
pb && s->
pb->
error < 0)
658 #define CHUNK_START 0x1000
672 #if FF_API_DESTRUCT_PACKET
707 int64_t syncto =
av_rescale(pkt->
dts + syncoffset, 1, max)*max - syncoffset;
720 && ((chunked && !((*next_point)->pkt.flags&
CHUNK_START))
721 || !compare(s, &(*next_point)->pkt, pkt)))
722 next_point = &(*next_point)->
next;
734 this_pktl->
next = *next_point;
737 *next_point = this_pktl;
756 comp= (ts>ts2) - (ts<ts2);
768 int stream_count = 0, noninterleaved_count = 0;
781 ++noninterleaved_count;
790 int64_t delta_dts = INT64_MIN;
805 delta_dts =
FFMAX(delta_dts, last_dts - top_dts);
810 "Delay between the first packet and last packet in the "
811 "muxing queue is %"PRId64
" > %"PRId64
": forcing output\n",
817 if (stream_count && flush) {
869 av_dlog(s,
"av_interleaved_write_frame size:%d dts:%s pts:%s\n",
879 av_dlog(s,
"av_interleaved_write_frame FLUSH\n");
887 memset(pkt, 0,
sizeof(*pkt));
953 int64_t *dts, int64_t *wall)
997 pkt.
data = (
void *)frame;