diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-04-10 21:42:17 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-04-12 20:29:28 +0200 |
commit | 9540476ba101874f7366e22ac24cdbde23d95968 (patch) | |
tree | 7c58260ad9d79865e7164f9773ac2046ea2077a3 | |
parent | eb24def4654a6e3d365d30fdf582ebb77c0b30db (diff) | |
download | ffmpeg-9540476ba101874f7366e22ac24cdbde23d95968.tar.gz |
latmenc: simplify using avpriv_copy_bits.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
-rw-r--r-- | libavformat/latmenc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c index 2d804ff299..1722eb59bf 100644 --- a/libavformat/latmenc.c +++ b/libavformat/latmenc.c @@ -168,7 +168,7 @@ static int latm_write_packet(AVFormatContext *s, AVPacket *pkt) /* The LATM payload is written unaligned */ - i = 0; + /* PayloadMux() */ if (pkt->size && (pkt->data[0] & 0xe1) == 0x81) { // Convert byte-aligned DSE to non-aligned. // Due to the input format encoding we know that @@ -179,11 +179,9 @@ static int latm_write_packet(AVFormatContext *s, AVPacket *pkt) // This allows us to remux our FATE AAC samples into latm // files that are still playable with minimal effort. put_bits(&bs, 8, pkt->data[0] & 0xfe); - i++; - } - /* PayloadMux() */ - for (; i < pkt->size; i++) - put_bits(&bs, 8, pkt->data[i]); + avpriv_copy_bits(&bs, pkt->data + 1, 8*pkt->size - 8); + } else + avpriv_copy_bits(&bs, pkt->data, 8*pkt->size); avpriv_align_put_bits(&bs); flush_put_bits(&bs); |