[FFmpeg-devel] [PATCH]Fix bug in setting the pts when decoding or transcoding Dirac video wrapped in MPEG-TS using libschroedingerdec.c

Anuradha Suraparaju asuraparaju
Wed Nov 24 00:27:06 CET 2010


On Tue, Nov 23, 2010 at 6:04 PM, Reimar D?ffinger
<Reimar.Doeffinger at gmx.de>wrote:

> On Tue, Nov 23, 2010 at 03:15:03PM +1100, Anuradha Suraparaju wrote:
> > On Fri, Nov 19, 2010 at 5:50 PM, Reimar D?ffinger
> > <Reimar.Doeffinger at gmx.de>wrote:
> > > On Fri, Nov 19, 2010 at 02:05:38PM +1100, Anuradha Suraparaju wrote:
> > > > +
> > > > +            if (avpkt->pts != AV_NOPTS_VALUE) {
> > > > +                FfmpegSchroPktTS *pktts =
> > > av_mallocz(sizeof(FfmpegSchroPktTS));
> > > > +                pktts->pts = avccontext->reordered_opaque;
> > > > +                pktts->dts = avpkt->dts;
> > > > +                enc_buf->tag = schro_tag_new(pktts, av_free);
> > > > +            } else {
> > > > +                if (SCHRO_PARSE_CODE_IS_PICTURE(enc_buf->data[4])) {
> > > > +                    FfmpegSchroPktTS *pktts =
> > > av_mallocz(sizeof(FfmpegSchroPktTS));
> > > > +                    int frame_number = AV_RB32(enc_buf->data + 13);
> > > > +                    if (p_schro_params->format->interlaced_coding)
> > > > +                       frame_number >>= 1;
> > > > +                    pktts->pts = av_rescale_q(frame_number,
> > > avccontext->time_base, AV_TIME_BASE_Q);
> > > > +                    pktts->dts = avpkt->dts;
> > > > +                    enc_buf->tag = schro_tag_new(pktts, av_free);
> > > > +                }
> > > > +            }
> > > >              state = schro_decoder_push(decoder, enc_buf);
> > > >              if (state == SCHRO_DECODER_FIRST_ACCESS_UNIT)
> > > >
>  libschroedinger_handle_first_access_unit(avccontext);
> > > [...]
> > > > +        if (f->p_tag) {
> > > > +            FfmpegSchroPktTS *pktts = f->p_tag->value;
> > > > +            picture->reordered_opaque = pktts->pts;
> > > > +        } else {
> > > > +            picture->reordered_opaque = AV_NOPTS_VALUE;
> > > > +        }
> > >
> > > You can't set reordered_opaque to arbitrary values either.
> > > An application might e.g. have put an array index to additional
> > > frame data (e.g. user data it needs to splice in), the encoder
> > > making up its own values would cause such an application to crash.
> > >
> >
> > But this is in the decoder and not encoder. reordered_opaque is being set
> to
> > the pts of the decoded frame and not an arbitrary value. If the objection
> is
> > to setting reordered_opaque to AV_NOPTS_VALUE, I'll omit that.
>
> According to the documentation you may only ever set it to a value
> in AVCodecContext.reordered_opaque, never ever anything else.
>

Sorry I am a bit confused still.

Does this mean that  reordered_opaque can only be set in AVCodecContext by
the decoder and not in AVFrame?

OR

Does it mean that the decoder can set the reordered_opaque field in AVFrame
to the value of reordered_opaque in AVCodecContext and nothing else? E.g in
rawdec.c the reordered_opaque field in the frame is set to the value in
AVCodecContext in raw_decode. Is this the only correct usage?

Thanks,
Anuradha

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



More information about the ffmpeg-devel mailing list