1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avcodec/flac: Remove unused parameter from ff_flac_is_extradata_valid()

format is write-only.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2022-08-28 16:27:06 +02:00
parent 17b1375965
commit 6699ed38f3
3 changed files with 1 additions and 11 deletions

View File

@@ -146,7 +146,6 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
} }
int ff_flac_is_extradata_valid(AVCodecContext *avctx, int ff_flac_is_extradata_valid(AVCodecContext *avctx,
enum FLACExtradataFormat *format,
uint8_t **streaminfo_start) uint8_t **streaminfo_start)
{ {
if (!avctx->extradata || avctx->extradata_size < FLAC_STREAMINFO_SIZE) { if (!avctx->extradata || avctx->extradata_size < FLAC_STREAMINFO_SIZE) {
@@ -159,14 +158,12 @@ int ff_flac_is_extradata_valid(AVCodecContext *avctx,
av_log(avctx, AV_LOG_WARNING, "extradata contains %d bytes too many.\n", av_log(avctx, AV_LOG_WARNING, "extradata contains %d bytes too many.\n",
FLAC_STREAMINFO_SIZE-avctx->extradata_size); FLAC_STREAMINFO_SIZE-avctx->extradata_size);
} }
*format = FLAC_EXTRADATA_FORMAT_STREAMINFO;
*streaminfo_start = avctx->extradata; *streaminfo_start = avctx->extradata;
} else { } else {
if (avctx->extradata_size < 8+FLAC_STREAMINFO_SIZE) { if (avctx->extradata_size < 8+FLAC_STREAMINFO_SIZE) {
av_log(avctx, AV_LOG_ERROR, "extradata too small.\n"); av_log(avctx, AV_LOG_ERROR, "extradata too small.\n");
return 0; return 0;
} }
*format = FLAC_EXTRADATA_FORMAT_FULL_HEADER;
*streaminfo_start = &avctx->extradata[8]; *streaminfo_start = &avctx->extradata[8];
} }
return 1; return 1;

View File

@@ -55,11 +55,6 @@ enum {
FLAC_METADATA_TYPE_INVALID = 127 FLAC_METADATA_TYPE_INVALID = 127
}; };
enum FLACExtradataFormat {
FLAC_EXTRADATA_FORMAT_STREAMINFO = 0,
FLAC_EXTRADATA_FORMAT_FULL_HEADER = 1
};
#define FLACCOMMONINFO \ #define FLACCOMMONINFO \
int samplerate; /**< sample rate */\ int samplerate; /**< sample rate */\
int channels; /**< number of channels */\ int channels; /**< number of channels */\
@@ -106,7 +101,6 @@ int ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
* @return 1 if valid, 0 if not valid. * @return 1 if valid, 0 if not valid.
*/ */
int ff_flac_is_extradata_valid(AVCodecContext *avctx, int ff_flac_is_extradata_valid(AVCodecContext *avctx,
enum FLACExtradataFormat *format,
uint8_t **streaminfo_start); uint8_t **streaminfo_start);
/** /**

View File

@@ -94,7 +94,6 @@ static void flac_set_bps(FLACContext *s)
static av_cold int flac_decode_init(AVCodecContext *avctx) static av_cold int flac_decode_init(AVCodecContext *avctx)
{ {
enum FLACExtradataFormat format;
uint8_t *streaminfo; uint8_t *streaminfo;
int ret; int ret;
FLACContext *s = avctx->priv_data; FLACContext *s = avctx->priv_data;
@@ -105,7 +104,7 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
if (!avctx->extradata) if (!avctx->extradata)
return 0; return 0;
if (!ff_flac_is_extradata_valid(avctx, &format, &streaminfo)) if (!ff_flac_is_extradata_valid(avctx, &streaminfo))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
/* initialize based on the demuxer-supplied streamdata header */ /* initialize based on the demuxer-supplied streamdata header */