[FFmpeg-devel] [PATCH 1/2] avcodec: add null encoders
Paul B Mahol
onemda at gmail.com
Tue Mar 15 10:53:39 EET 2022
On Tue, Mar 15, 2022 at 9:47 AM Anton Khirnov <anton at khirnov.net> wrote:
> Quoting Paul B Mahol (2022-03-14 12:56:01)
> > +static int null_encoder(AVCodecContext *avctx, AVPacket *pkt,
> > + const AVFrame *frame, int *got_packet)
> > +{
> > + int ret;
> > +
> > + pkt->pts = frame->pts;
> > + if (avctx->codec_type == AVMEDIA_TYPE_AUDIO)
> > + pkt->duration = ff_samples_to_time_base(avctx,
> frame->nb_samples);
> > + pkt->flags |= AV_PKT_FLAG_KEY;
> > + if ((ret = ff_alloc_packet(avctx, pkt, 1)) < 0)
> > + return ret;
> > + *got_packet = 1;
>
> Why return packets at all? Wouldn't it be simpler to just never return
> any data?
>
But than there is no progress report at all.
>
> --
> Anton Khirnov
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
More information about the ffmpeg-devel
mailing list