diff mbox series

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

Message ID 20200830145045.4437-1-andreas.rheinhardt@gmail.com
State Accepted
Commit e4a650b61ab8b52230ff7fd63823d1a34706d51a
Headers show
Series [FFmpeg-devel,1/5] avdevice/lavfi: Use av_packet_move_ref() for packet ownership transfer | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 30, 2020, 2:50 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavdevice/lavfi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Paul B Mahol Aug. 31, 2020, 12:46 p.m. UTC | #1
On 8/30/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavdevice/lavfi.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>

LGTM if tested.

I think  this is covered by FATE.

> 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
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Andreas Rheinhardt Aug. 31, 2020, 4:31 p.m. UTC | #2
Paul B Mahol:
> On 8/30/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@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
>>
diff mbox series

Patch

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;
     }