avcodec/flac: Don't use bytestream API unnecessarily

It makes no sense here, as flac_parse_block_header()
is not even supposed to advance the caller's pointer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-08-28 17:21:03 +02:00
parent 5089884e3c
commit 7de9c0e9d7
2 changed files with 4 additions and 3 deletions
libavcodec
libavformat

@ -27,7 +27,7 @@
#ifndef AVCODEC_FLAC_H #ifndef AVCODEC_FLAC_H
#define AVCODEC_FLAC_H #define AVCODEC_FLAC_H
#include "bytestream.h" #include "libavutil/intreadwrite.h"
#define FLAC_STREAMINFO_SIZE 34 #define FLAC_STREAMINFO_SIZE 34
#define FLAC_MAX_CHANNELS 8 #define FLAC_MAX_CHANNELS 8
@ -63,13 +63,13 @@ enum {
static av_always_inline void flac_parse_block_header(const uint8_t *block_header, static av_always_inline void flac_parse_block_header(const uint8_t *block_header,
int *last, int *type, int *size) int *last, int *type, int *size)
{ {
int tmp = bytestream_get_byte(&block_header); int tmp = *block_header;
if (last) if (last)
*last = tmp & 0x80; *last = tmp & 0x80;
if (type) if (type)
*type = tmp & 0x7F; *type = tmp & 0x7F;
if (size) if (size)
*size = bytestream_get_be24(&block_header); *size = AV_RB24(block_header + 1);
} }
#endif /* AVCODEC_FLAC_H */ #endif /* AVCODEC_FLAC_H */

@ -20,6 +20,7 @@
*/ */
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/flac.h" #include "libavcodec/flac.h"
#include "avformat.h" #include "avformat.h"
#include "demux.h" #include "demux.h"