[FFmpeg-devel] [PATCH 1/5] avdevice/lavfi: Use av_packet_move_ref() for packet ownership transfer

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Mon Aug 31 19:31:06 EEST 2020


Paul B Mahol:
> On 8/30/20, Andreas Rheinhardt <andreas.rheinhardt at gmail.com> wrote:
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
>> ---
>>  libavdevice/lavfi.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
> 
> LGTM if tested.
> 
> I think  this is covered by FATE.
> 

It is, see [1]. All patches of this patchset except 4/5 are covered by it.

- Andreas

[1]: http://coverage.ffmpeg.org/index.src_libavdevice_lavfi.c.html

>> diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
>> index c949ff7e12..2a95cb013c 100644
>> --- a/libavdevice/lavfi.c
>> +++ b/libavdevice/lavfi.c
>> @@ -392,10 +392,7 @@ static int lavfi_read_packet(AVFormatContext *avctx,
>> AVPacket *pkt)
>>      int size = 0;
>>
>>      if (lavfi->subcc_packet.size) {
>> -        *pkt = lavfi->subcc_packet;
>> -        av_init_packet(&lavfi->subcc_packet);
>> -        lavfi->subcc_packet.size = 0;
>> -        lavfi->subcc_packet.data = NULL;
>> +        av_packet_move_ref(pkt, &lavfi->subcc_packet);
>>          return pkt->size;
>>      }
>>
>> --
>> 2.20.1
>>


More information about the ffmpeg-devel mailing list