summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-04-14 00:20:52 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-04-14 00:20:52 +0000
commit7c8689ef5401bb462006cb7d555efc380f320b17 (patch)
tree032ebcdcd271ec8ddf03372f871afd4688331e53 /ffmpeg.c
parentbee3140a885e6a067adbb97c1cdf7514143c1d01 (diff)
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
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 1a4fcfbc48..4be4b92681 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1469,6 +1469,8 @@ static int output_packet(AVInputStream *ist, int ist_index,
enc->frame_size = fifo_bytes / (2 * enc->channels);
av_fifo_generic_read(ost->fifo, samples, fifo_bytes, NULL);
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;
}
if(ret <= 0) {