git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddce7da
)
mpegmux: add stuffing to avoid incomplete PCM frames
author
Janne Grunau
<janne-libav@jannau.net>
Tue, 13 Mar 2012 17:12:06 +0000
(18:12 +0100)
committer
Janne Grunau
<janne-libav@jannau.net>
Sun, 6 May 2012 11:18:38 +0000
(13:18 +0200)
Fixes https://bugzilla.libav.org/show_bug.cgi?id=244
libavformat/mpegenc.c
patch
|
blob
|
history
diff --git
a/libavformat/mpegenc.c
b/libavformat/mpegenc.c
index
bda8d83
..
7bcf289
100644
(file)
--- a/
libavformat/mpegenc.c
+++ b/
libavformat/mpegenc.c
@@
-832,6
+832,12
@@
static int flush_packet(AVFormatContext *ctx, int stream_index,
if (stuffing_size < 0)
stuffing_size = 0;
+
+ if (startcode == PRIVATE_STREAM_1 && id >= 0xa0) {
+ if (payload_size < av_fifo_size(stream->fifo))
+ stuffing_size += payload_size % stream->lpcm_align;
+ }
+
if (stuffing_size > 16) { /*<=16 for MPEG-1, <=32 for MPEG-2*/
pad_packet_bytes += stuffing_size;
packet_size -= stuffing_size;