[FFmpeg-devel] [PATCH] avformat/utils: Preserve AV_PKT_FLAG_CORRUPT
Michael Niedermayer
michael at niedermayer.cc
Fri Mar 19 15:58:06 EET 2021
On Wed, Mar 17, 2021 at 06:19:26PM -0600, Pavel Koshevoy wrote:
> Preserve AV_PKT_FLAG_CORRUPT so the caller can decide whether to drop
> the packet.
> ---
> 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);
1. assume the parsers input are a stream of 4kb packets, the output is lets say 101kb
packets. Assumingh one input packet is corrupted which output packet if any
gets the flag set and why is that the correct one ?
2. assume the parsers input are a stream of 128kb packets, the output is lets say 3kb
packets. Assuming one input packet is corrupted which output packet if any
gets the flag set and why is that the correct one ?
Thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210319/e8f1644f/attachment.sig>
More information about the ffmpeg-devel
mailing list