Re: [libav-devel] [PATCH 02/15] lavc: do not overwrite frame parameters of delayed frames
Hi, On Wed, Dec 12, 2012 at 12:30 PM, Janne Grunau wrote: > Decoders supporting frame parameter changes can return delayed frames > with the old parameters. > --- > libavcodec/utils.c | 15 ++- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > index 1185a35..97fa570 100644 > --- a/libavcodec/utils.c > +++ b/libavcodec/utils.c > @@ -1282,11 +1282,16 @@ int attribute_align_arg > avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi > else { > ret = avctx->codec->decode(avctx, picture, got_picture_ptr, > avpkt); > -picture->pkt_dts = avpkt->dts; > -picture->sample_aspect_ratio = avctx->sample_aspect_ratio; > -picture->width = avctx->width; > -picture->height = avctx->height; > -picture->format = avctx->pix_fmt; > +picture->pkt_dts = avpkt->dts; > + > +/* delayed pictures might have different parameters than > + * the context returning them */ > +if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) { > +picture->sample_aspect_ratio = avctx->sample_aspect_ratio; > +picture->width = avctx->width; > +picture->height = avctx->height; > +picture->format = avctx->pix_fmt; > +} > } I can live with this. We can clean this further later. Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 02/15] lavc: do not overwrite frame parameters of delayed frames
On 2012-12-12 21:43:07 +0100, Anton Khirnov wrote: > > On Wed, 12 Dec 2012 21:30:03 +0100, Janne Grunau > wrote: > > Decoders supporting frame parameter changes can return delayed frames > > with the old parameters. > > --- > > libavcodec/utils.c | 15 ++- > > 1 file changed, 10 insertions(+), 5 deletions(-) > > > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > > index 1185a35..97fa570 100644 > > --- a/libavcodec/utils.c > > +++ b/libavcodec/utils.c > > @@ -1282,11 +1282,16 @@ int attribute_align_arg > > avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi > > else { > > ret = avctx->codec->decode(avctx, picture, got_picture_ptr, > > avpkt); > > -picture->pkt_dts = avpkt->dts; > > -picture->sample_aspect_ratio = avctx->sample_aspect_ratio; > > -picture->width = avctx->width; > > -picture->height = avctx->height; > > -picture->format = avctx->pix_fmt; > > +picture->pkt_dts = avpkt->dts; > > + > > +/* delayed pictures might have different parameters than > > + * the context returning them */ > > +if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) { > > +picture->sample_aspect_ratio = avctx->sample_aspect_ratio; > > +picture->width = avctx->width; > > +picture->height = avctx->height; > > +picture->format = avctx->pix_fmt; > > +} > > } > > > > Frame properties are also set in ff_get_buffer(), so this block does not > need to be there at all for decoders using it. Which IIRC is everything > except rawdec, so we could just move this to rawdec. at least fate-vsynth1-cljr, fate-vsynth1-asv2 and fate-vsynth1-asv1 were failing with this removed. get_buffer() would require DR1 and would not be that different from this check. Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 02/15] lavc: do not overwrite frame parameters of delayed frames
On Wed, 12 Dec 2012 21:30:03 +0100, Janne Grunau wrote: > Decoders supporting frame parameter changes can return delayed frames > with the old parameters. > --- > libavcodec/utils.c | 15 ++- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c > index 1185a35..97fa570 100644 > --- a/libavcodec/utils.c > +++ b/libavcodec/utils.c > @@ -1282,11 +1282,16 @@ int attribute_align_arg > avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi > else { > ret = avctx->codec->decode(avctx, picture, got_picture_ptr, > avpkt); > -picture->pkt_dts = avpkt->dts; > -picture->sample_aspect_ratio = avctx->sample_aspect_ratio; > -picture->width = avctx->width; > -picture->height = avctx->height; > -picture->format = avctx->pix_fmt; > +picture->pkt_dts = avpkt->dts; > + > +/* delayed pictures might have different parameters than > + * the context returning them */ > +if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) { > +picture->sample_aspect_ratio = avctx->sample_aspect_ratio; > +picture->width = avctx->width; > +picture->height = avctx->height; > +picture->format = avctx->pix_fmt; > +} > } > Frame properties are also set in ff_get_buffer(), so this block does not need to be there at all for decoders using it. Which IIRC is everything except rawdec, so we could just move this to rawdec. -- Anton Khirnov ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel