On Thu, Mar 18, 2021 at 2:51 PM Marton Balint <[email protected]> wrote:

>
>
> On Wed, 17 Mar 2021, Pavel Koshevoy wrote:
>
> > Preserve AV_PKT_FLAG_CORRUPT so the caller can decide whether to drop
> > the packet.
>
> LGTM, but Michael was against it last time:
>
>
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/[email protected]/
>
>
>

I have a source where a corrupt packet is able to poison the video decoder
so that the subsequent video is decoded with severe visual artifacts.  My
workaround is to detect corrupt packets, drop them and  re-create the video
decoder on the next non-corrupt packet.  This workaround is working well so
far.

Pavel.




> > ---
> > libavformat/utils.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index a73f944e6e..0dc978e3d2 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -1494,7 +1494,8 @@ static int parse_packet(AVFormatContext *s,
> AVPacket *pkt,
> >         out_pkt->pts          = st->parser->pts;
> >         out_pkt->dts          = st->parser->dts;
> >         out_pkt->pos          = st->parser->pos;
> > -        out_pkt->flags       |= pkt->flags & AV_PKT_FLAG_DISCARD;
> > +        out_pkt->flags       |= pkt->flags & (AV_PKT_FLAG_CORRUPT |
> > +                                              AV_PKT_FLAG_DISCARD);
> >
> >         if (st->need_parsing == AVSTREAM_PARSE_FULL_RAW)
> >             out_pkt->pos = st->parser->frame_offset;
> > --
> > 2.26.2
> >
> > _______________________________________________
> > 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".
> _______________________________________________
> 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".
_______________________________________________
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".

Reply via email to