[FFmpeg-cvslog] avdevice/lavfi: Don't reimplement av_frame_get_side_data()
Andreas Rheinhardt
git at videolan.org
Tue Sep 1 10:50:16 EEST 2020
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Aug 30 05:49:46 2020 +0200| [ebd485db926889b5686cab440a6f514d6831209f] | committer: Andreas Rheinhardt
avdevice/lavfi: Don't reimplement av_frame_get_side_data()
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ebd485db926889b5686cab440a6f514d6831209f
---
libavdevice/lavfi.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 2a95cb013c..5e814eada8 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -362,16 +362,12 @@ static int create_subcc_packet(AVFormatContext *avctx, AVFrame *frame,
{
LavfiContext *lavfi = avctx->priv_data;
AVFrameSideData *sd;
- int stream_idx, i, ret;
+ int stream_idx, ret;
if ((stream_idx = lavfi->sink_stream_subcc_map[sink_idx]) < 0)
return 0;
- for (i = 0; i < frame->nb_side_data; i++)
- if (frame->side_data[i]->type == AV_FRAME_DATA_A53_CC)
- break;
- if (i >= frame->nb_side_data)
+ if (!(sd = av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC)))
return 0;
- sd = frame->side_data[i];
if ((ret = av_new_packet(&lavfi->subcc_packet, sd->size)) < 0)
return ret;
memcpy(lavfi->subcc_packet.data, sd->data, sd->size);
More information about the ffmpeg-cvslog
mailing list