Message ID | 20200830145045.4437-5-andreas.rheinhardt@gmail.com |
---|---|
State | Accepted |
Commit | 901251d59bd287954f334bc153a0d71853debb92 |
Headers | show |
Series | [FFmpeg-devel,1/5] avdevice/lavfi: Use av_packet_move_ref() for packet ownership transfer | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
On 8/30/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote: > av_new_packet() already sets the size. And if the packet is not > allocated by av_new_packet() (which seems to be impossible atm), both > pkt->size as well as size are 0, so setting it again is unnecessary in > this scenario, too. > > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> > --- > libavdevice/lavfi.c | 1 - > 1 file changed, 1 deletion(-) > LGTM > diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c > index 2b4e9290dc..4f05a1542e 100644 > --- a/libavdevice/lavfi.c > +++ b/libavdevice/lavfi.c > @@ -464,7 +464,6 @@ static int lavfi_read_packet(AVFormatContext *avctx, > AVPacket *pkt) > pkt->stream_index = stream_idx; > pkt->pts = frame->pts; > pkt->pos = frame->pkt_pos; > - pkt->size = size; > av_frame_unref(frame); > return 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".
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 2b4e9290dc..4f05a1542e 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -464,7 +464,6 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) pkt->stream_index = stream_idx; pkt->pts = frame->pts; pkt->pos = frame->pkt_pos; - pkt->size = size; av_frame_unref(frame); return size; }
av_new_packet() already sets the size. And if the packet is not allocated by av_new_packet() (which seems to be impossible atm), both pkt->size as well as size are 0, so setting it again is unnecessary in this scenario, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavdevice/lavfi.c | 1 - 1 file changed, 1 deletion(-)