diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index ff25d79..6b011be 100644
|
a
|
b
|
static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 523 | 523 | AVIStream *avist= s->streams[stream_index]->priv_data; |
| 524 | 524 | AVCodecContext *enc= s->streams[stream_index]->codec; |
| 525 | 525 | int size= pkt->size; |
| | 526 | int insert_emptied=0; |
| | 527 | static int total_inserted = 0; // FIXME all stream |
| 526 | 528 | |
| 527 | 529 | // av_log(s, AV_LOG_DEBUG, "%"PRId64" %d %d\n", pkt->dts, avist->packet_count, stream_index); |
| 528 | 530 | while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB){ |
| 529 | 531 | AVPacket empty_packet; |
| 530 | 532 | |
| 531 | | if(pkt->dts - avist->packet_count > 60000){ |
| | 533 | if( (pkt->dts - avist->packet_count) > 60000){ |
| 532 | 534 | av_log(s, AV_LOG_ERROR, "Too large number of skiped frames %"PRId64"\n", pkt->dts - avist->packet_count); |
| 533 | 535 | return AVERROR(EINVAL); |
| 534 | 536 | } |
| … |
… |
static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 538 | 540 | empty_packet.data= NULL; |
| 539 | 541 | empty_packet.stream_index= stream_index; |
| 540 | 542 | avi_write_packet(s, &empty_packet); |
| | 543 | insert_emptied++; |
| 541 | 544 | // av_log(s, AV_LOG_DEBUG, "dup %"PRId64" %d\n", pkt->dts, avist->packet_count); |
| 542 | 545 | } |
| | 546 | |
| | 547 | if ( insert_emptied > 0 ) { |
| | 548 | total_inserted += insert_emptied; |
| | 549 | av_log(s, AV_LOG_INFO, "%c: insert %d empty pkt, total empty %d from %d, %d%%\n", |
| | 550 | enc->codec_type == AVMEDIA_TYPE_VIDEO ? 'V' : (enc->codec_type == AVMEDIA_TYPE_AUDIO ? 'A' : '?'), |
| | 551 | insert_emptied, |
| | 552 | total_inserted, avist->packet_count, |
| | 553 | (total_inserted * 100) / avist->packet_count); |
| | 554 | } |
| 543 | 555 | avist->packet_count++; |
| 544 | 556 | |
| 545 | 557 | // Make sure to put an OpenDML chunk when the file size exceeds the limits |