diff options
Diffstat (limited to 'libavformat/latmenc.c')
-rw-r--r-- | libavformat/latmenc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c index 5190ac7b20..a98a6ff6b0 100644 --- a/libavformat/latmenc.c +++ b/libavformat/latmenc.c @@ -74,10 +74,10 @@ static int latm_decode_extradata(LATMContext *ctx, uint8_t *buf, int size) static int latm_write_header(AVFormatContext *s) { LATMContext *ctx = s->priv_data; - AVCodecContext *avctx = s->streams[0]->codec; + AVCodecParameters *par = s->streams[0]->codecpar; - if (avctx->extradata_size > 0 && - latm_decode_extradata(ctx, avctx->extradata, avctx->extradata_size) < 0) + if (par->extradata_size > 0 && + latm_decode_extradata(ctx, par->extradata, par->extradata_size) < 0) return AVERROR_INVALIDDATA; return 0; @@ -86,7 +86,7 @@ static int latm_write_header(AVFormatContext *s) static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs) { LATMContext *ctx = s->priv_data; - AVCodecContext *avctx = s->streams[0]->codec; + AVCodecParameters *par = s->streams[0]->codecpar; GetBitContext gb; int header_size; @@ -94,7 +94,7 @@ static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs) put_bits(bs, 1, !!ctx->counter); if (!ctx->counter) { - init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8); + init_get_bits(&gb, par->extradata, par->extradata_size * 8); /* StreamMuxConfig */ put_bits(bs, 1, 0); /* audioMuxVersion */ @@ -105,10 +105,10 @@ static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs) /* AudioSpecificConfig */ if (ctx->object_type == AOT_ALS) { - header_size = avctx->extradata_size-(ctx->off + 7) >> 3; - avpriv_copy_bits(bs, &avctx->extradata[ctx->off], header_size); + header_size = par->extradata_size-(ctx->off + 7) >> 3; + avpriv_copy_bits(bs, &par->extradata[ctx->off], header_size); } else { - avpriv_copy_bits(bs, avctx->extradata, ctx->off + 3); + avpriv_copy_bits(bs, par->extradata, ctx->off + 3); if (!ctx->channel_conf) { avpriv_copy_pce_data(bs, &gb); |