This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 77243d19958077f81f954bb9978527483b6c0060 Author: Romain Beauxis <[email protected]> AuthorDate: Sat Oct 31 09:27:28 2026 -0500 Commit: Romain Beauxis <[email protected]> CommitDate: Sat Nov 7 15:00:17 2026 +0000 avcodec/vorbisdec: factor out parsing the headers Move parsing the identification and setup headers out of initialization, so that headers arriving later can be parsed the same way. --- libavcodec/vorbisdec.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 111fe44318..e952af825c 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -1057,26 +1057,15 @@ static int vorbis_parse_id_hdr(vorbis_context *vc) // Process the extradata using the functions above (identification header, setup header) -static av_cold int vorbis_decode_init(AVCodecContext *avctx) +static int vorbis_parse_headers(AVCodecContext *avctx, + const uint8_t *headers, int headers_len) { vorbis_context *vc = avctx->priv_data; - uint8_t *headers = avctx->extradata; - int headers_len = avctx->extradata_size; const uint8_t *header_start[3]; int header_len[3]; GetBitContext *gb = &vc->gb; int hdr_type, ret; - vc->avctx = avctx; - ff_vorbisdsp_init(&vc->dsp); - - avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; - - if (!headers_len) { - av_log(avctx, AV_LOG_ERROR, "Extradata missing.\n"); - return AVERROR_INVALIDDATA; - } - if ((ret = avpriv_split_xiph_headers(headers, headers_len, 30, header_start, header_len)) < 0) { av_log(avctx, AV_LOG_ERROR, "Extradata corrupt.\n"); return ret; @@ -1120,6 +1109,23 @@ static av_cold int vorbis_decode_init(AVCodecContext *avctx) return 0; } +static av_cold int vorbis_decode_init(AVCodecContext *avctx) +{ + vorbis_context *vc = avctx->priv_data; + + vc->avctx = avctx; + ff_vorbisdsp_init(&vc->dsp); + + avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; + + if (!avctx->extradata_size) { + av_log(avctx, AV_LOG_ERROR, "Extradata missing.\n"); + return AVERROR_INVALIDDATA; + } + + return vorbis_parse_headers(avctx, avctx->extradata, avctx->extradata_size); +} + // Decode audiopackets ------------------------------------------------- // Read and decode floor -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
