[FFmpeg-devel] [PATCH] latmenc: copy pce config from proper location.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Apr 9 01:00:02 CEST 2012


For the FATE test sample used, this only avoids a warning
message.
However for other samples like al05_44.mp4 the converted
file can be played only after this fix.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavformat/latmenc.c    |    6 +++---
 tests/ref/lavf-fate/latm |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c
index 4ca4237..c4befea 100644
--- a/libavformat/latmenc.c
+++ b/libavformat/latmenc.c
@@ -88,15 +88,12 @@ static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
 {
     LATMContext *ctx = s->priv_data;
     AVCodecContext *avctx = s->streams[0]->codec;
-    GetBitContext gb;
     int header_size;
 
     /* AudioMuxElement */
     put_bits(bs, 1, !!ctx->counter);
 
     if (!ctx->counter) {
-        init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8);
-
         /* StreamMuxConfig */
         put_bits(bs, 1, 0); /* audioMuxVersion */
         put_bits(bs, 1, 1); /* allStreamsSameTimeFraming */
@@ -112,6 +109,9 @@ static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
             avpriv_copy_bits(bs, avctx->extradata, ctx->off + 3);
 
             if (!ctx->channel_conf) {
+                GetBitContext gb;
+                init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8);
+                skip_bits_long(&gb, ctx->off + 3);
                 avpriv_copy_pce_data(bs, &gb);
             }
         }
diff --git a/tests/ref/lavf-fate/latm b/tests/ref/lavf-fate/latm
index 00fca2c..11de08b 100644
--- a/tests/ref/lavf-fate/latm
+++ b/tests/ref/lavf-fate/latm
@@ -1,3 +1,3 @@
-b46312c2d47d11b635c1e0b057b3d7ef *./tests/data/lavf-fate/lavf.latm
+226e17ff1214c423195a3f407aa6e5d2 *./tests/data/lavf-fate/lavf.latm
 65536 ./tests/data/lavf-fate/lavf.latm
-./tests/data/lavf-fate/lavf.latm CRC=0x532cf5f9
+./tests/data/lavf-fate/lavf.latm CRC=0x915b714e
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list