|
|
|
@ -98,16 +98,16 @@ static int queue_packet(OutputFile *of, OutputStream *ost, AVPacket *pkt) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pkt) { |
|
|
|
|
ret = av_packet_make_refcounted(pkt); |
|
|
|
|
if (ret < 0) |
|
|
|
|
return ret; |
|
|
|
|
ret = av_packet_make_refcounted(pkt); |
|
|
|
|
if (ret < 0) |
|
|
|
|
return ret; |
|
|
|
|
|
|
|
|
|
tmp_pkt = av_packet_alloc(); |
|
|
|
|
if (!tmp_pkt) |
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
|
tmp_pkt = av_packet_alloc(); |
|
|
|
|
if (!tmp_pkt) |
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
|
|
|
|
|
|
av_packet_move_ref(tmp_pkt, pkt); |
|
|
|
|
ms->muxing_queue_data_size += tmp_pkt->size; |
|
|
|
|
av_packet_move_ref(tmp_pkt, pkt); |
|
|
|
|
ms->muxing_queue_data_size += tmp_pkt->size; |
|
|
|
|
} |
|
|
|
|
av_fifo_write(ms->muxing_queue, &tmp_pkt, 1); |
|
|
|
|
|
|
|
|
@ -236,20 +236,20 @@ void of_submit_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost) |
|
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
if (pkt) { |
|
|
|
|
/*
|
|
|
|
|
* Audio encoders may split the packets -- #frames in != #packets out. |
|
|
|
|
* But there is no reordering, so we can limit the number of output packets |
|
|
|
|
* by simply dropping them here. |
|
|
|
|
* Counting encoded video frames needs to be done separately because of |
|
|
|
|
* reordering, see do_video_out(). |
|
|
|
|
*/ |
|
|
|
|
if (!(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->encoding_needed)) { |
|
|
|
|
if (ost->frame_number >= ost->max_frames) { |
|
|
|
|
av_packet_unref(pkt); |
|
|
|
|
return; |
|
|
|
|
/*
|
|
|
|
|
* Audio encoders may split the packets -- #frames in != #packets out. |
|
|
|
|
* But there is no reordering, so we can limit the number of output packets |
|
|
|
|
* by simply dropping them here. |
|
|
|
|
* Counting encoded video frames needs to be done separately because of |
|
|
|
|
* reordering, see do_video_out(). |
|
|
|
|
*/ |
|
|
|
|
if (!(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->encoding_needed)) { |
|
|
|
|
if (ost->frame_number >= ost->max_frames) { |
|
|
|
|
av_packet_unref(pkt); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ost->frame_number++; |
|
|
|
|
} |
|
|
|
|
ost->frame_number++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (of->mux->header_written) { |
|
|
|
|