Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-14 Thread Andreas Rheinhardt
James Almer: > On 3/11/2021 5:08 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 3/11/2021 3:26 PM, Andreas Rheinhardt wrote: James Almer: > On 3/11/2021 2:48 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 3/11/2021 2:27 PM, Andreas Rheinhardt wrote: James Almer

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-14 Thread Andreas Rheinhardt
James Almer: > On 3/14/2021 7:34 AM, Anton Khirnov wrote: >> Quoting James Almer (2021-03-12 18:24:47) >>> >>> The padding exists AFAIK because something, like an optimized bitstream >>> reader that tries to process several bytes at the same time, may end up >>> reading or writing pass the reported

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-14 Thread Andreas Rheinhardt
Michael Niedermayer: > On Sun, Mar 14, 2021 at 04:51:44PM +0100, Anton Khirnov wrote: >> Quoting James Almer (2021-03-14 16:35:48) >>> On 3/14/2021 7:34 AM, Anton Khirnov wrote: Quoting James Almer (2021-03-12 18:24:47) > > The padding exists AFAIK because something, like an optimized

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-14 Thread Andreas Rheinhardt
Marton Balint: > > > On Fri, 12 Mar 2021, James Almer wrote: > I get a packet from a demuxer. It contains two independent portions (NALUs, OBUs, etc) i want to separate in order to feed them to something like a multi threaded decoder. And so I create a new reference to i

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-14 Thread Michael Niedermayer
On Sun, Mar 14, 2021 at 04:51:44PM +0100, Anton Khirnov wrote: > Quoting James Almer (2021-03-14 16:35:48) > > On 3/14/2021 7:34 AM, Anton Khirnov wrote: > > > Quoting James Almer (2021-03-12 18:24:47) > > >> > > >> The padding exists AFAIK because something, like an optimized bitstream > > >> read

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-14 Thread James Almer
On 3/14/2021 7:34 AM, Anton Khirnov wrote: Quoting James Almer (2021-03-12 18:24:47) The padding exists AFAIK because something, like an optimized bitstream reader that tries to process several bytes at the same time, may end up reading or writing pass the reported end of the buffer. That means

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-13 Thread Marton Balint
On Fri, 12 Mar 2021, James Almer wrote: I get a packet from a demuxer. It contains two independent portions (NALUs, OBUs, etc) i want to separate in order to feed them to something like a multi threaded decoder. And so I create a new reference to it, resulting in two packets pointing to th

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-12 Thread James Almer
On 3/12/2021 2:09 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: On 3/11/2021 7:40 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: This function acts as a replacemen

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-12 Thread Marton Balint
On Thu, 11 Mar 2021, James Almer wrote: On 3/11/2021 7:40 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: This function acts as a replacement for both av_grow_packet() and av_shrink_pa

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread James Almer
On 3/11/2021 7:40 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: This function acts as a replacement for both av_grow_packet() and av_shrink_packet(), the latter which is now deprecated a

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread Marton Balint
On Thu, 11 Mar 2021, James Almer wrote: On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: This function acts as a replacement for both av_grow_packet() and av_shrink_packet(), the latter which is now deprecated and will be removed as it does not correctl

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread James Almer
On 3/11/2021 5:08 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 3:26 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 2:48 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 2:27 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread Andreas Rheinhardt
James Almer: > On 3/11/2021 3:26 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 3/11/2021 2:48 PM, Andreas Rheinhardt wrote: James Almer: > On 3/11/2021 2:27 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote: James Almer

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread James Almer
On 3/11/2021 3:26 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 2:48 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 2:27 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 1:11 PM, Marton Balint wrote:

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread Andreas Rheinhardt
James Almer: > On 3/11/2021 2:48 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 3/11/2021 2:27 PM, Andreas Rheinhardt wrote: James Almer: > On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 3/11/2021 1:11 PM, Marton Balint wrote: >>>

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread James Almer
On 3/11/2021 2:48 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 2:27 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: This function acts as

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread Andreas Rheinhardt
James Almer: > On 3/11/2021 2:27 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote: James Almer: > On 3/11/2021 1:11 PM, Marton Balint wrote: >> >> >> On Thu, 11 Mar 2021, James Almer wrote: >> >>> This function acts as a r

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread James Almer
On 3/11/2021 2:27 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: This function acts as a replacement for both av_grow_packet() and av_shrink_packet()

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread Andreas Rheinhardt
James Almer: > On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: > This function acts as a replacement for both av_grow_packet() and > av_shrink_packet(), the latter whic

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread James Almer
On 3/11/2021 1:56 PM, Andreas Rheinhardt wrote: James Almer: On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: This function acts as a replacement for both av_grow_packet() and av_shrink_packet(), the latter which is now deprecated and will be removed as it

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread Andreas Rheinhardt
James Almer: > On 3/11/2021 1:11 PM, Marton Balint wrote: >> >> >> On Thu, 11 Mar 2021, James Almer wrote: >> >>> This function acts as a replacement for both av_grow_packet() and >>> av_shrink_packet(), the latter which is now deprecated and will be >>> removed as >>> it does not correctly handle

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread James Almer
On 3/11/2021 1:11 PM, Marton Balint wrote: On Thu, 11 Mar 2021, James Almer wrote: This function acts as a replacement for both av_grow_packet() and av_shrink_packet(), the latter which is now deprecated and will be removed as it does not correctly handle non-writable packets. I don't thi

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread Marton Balint
On Thu, 11 Mar 2021, James Almer wrote: This function acts as a replacement for both av_grow_packet() and av_shrink_packet(), the latter which is now deprecated and will be removed as it does not correctly handle non-writable packets. I don't think this is a good idea, av_shrink_packet canno

[FFmpeg-devel] [PATCH 1/3] avcodec/avpacket: add av_packet_resize()

2021-03-11 Thread James Almer
This function acts as a replacement for both av_grow_packet() and av_shrink_packet(), the latter which is now deprecated and will be removed as it does not correctly handle non-writable packets. Signed-off-by: James Almer --- libavcodec/avpacket.c | 19 +++ libavcodec/packet.h