On Sun, Jan 12, 2025 at 12:42:05AM -0300, James Almer wrote:
> On 1/11/2025 11:37 PM, Peter Ross wrote:
> > ---
> > libavcodec/Makefile | 1 +
> > libavcodec/allcodecs.c | 1 +
> > libavcodec/codec_desc.c | 7 ++
> > libavcodec/codec_id.h | 1 +
> > libavcodec/g728data.h | 70 +++++++++++++
> > libavcodec/g728dec.c | 213 ++++++++++++++++++++++++++++++++++++++++
> > libavcodec/utils.c | 1 +
> > 7 files changed, 294 insertions(+)
> > create mode 100644 libavcodec/g728data.h
> > create mode 100644 libavcodec/g728dec.c
>
> [...]
>
> > +
> > +static int g728_decode_frame(AVCodecContext *avctx, AVFrame *frame,
> > + int *got_frame_ptr, AVPacket *avpkt)
> > +{
> > + G728Context *s = avctx->priv_data;
> > + GetBitContext gb;
> > + int ret;
> > +
> > + if (avpkt->size < 5)
> > + return AVERROR_INVALIDDATA;
> > +
> > + if ((ret = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
> > + return ret;
> > +
> > + frame->nb_samples = 20;
> > + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
> > + return ret;
> > +
> > + decode_frame(s, &gb, (float *)frame->data[0]);
>
> I assume this means the codec is mono only, right? I see you set
> AV_CODEC_CAP_CHANNEL_CONF below (meaning the decoder will set channel
> information and not depend on the caller doing it), but then don't force
> mono layout in avctx->ch_layout anywhere.
> You need to do it in g728_decode_init(), first uninitializing the existing
> layout and then setting it to mono.Yeah that was what I intended. Thanks for spotting this. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
