mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-21 23:00:04 +08:00
set pkt duration for last smaller frame, should fix alac in m4a muxing
Originally committed as revision 18504 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
2
ffmpeg.c
2
ffmpeg.c
@ -1469,6 +1469,8 @@ static int output_packet(AVInputStream *ist, int ist_index,
|
|||||||
enc->frame_size = fifo_bytes / (2 * enc->channels);
|
enc->frame_size = fifo_bytes / (2 * enc->channels);
|
||||||
av_fifo_generic_read(ost->fifo, samples, fifo_bytes, NULL);
|
av_fifo_generic_read(ost->fifo, samples, fifo_bytes, NULL);
|
||||||
ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, samples);
|
ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, samples);
|
||||||
|
pkt.duration = av_rescale((int64_t)enc->frame_size*ost->st->time_base.den,
|
||||||
|
ost->st->time_base.num, enc->sample_rate);
|
||||||
enc->frame_size = fs_tmp;
|
enc->frame_size = fs_tmp;
|
||||||
}
|
}
|
||||||
if(ret <= 0) {
|
if(ret <= 0) {
|
||||||
|
Reference in New Issue
Block a user