mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-05 22:40:09 +01:00
fftools: pass global side data through using a separate array
This keeps global and per frame side data clearly separated, and actually propagates the former as it comes out from the buffersink filter. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -400,6 +400,7 @@ static void frame_data_free(void *opaque, uint8_t *data)
|
||||
{
|
||||
FrameData *fd = (FrameData *)data;
|
||||
|
||||
av_frame_side_data_free(&fd->side_data, &fd->nb_side_data);
|
||||
avcodec_parameters_free(&fd->par_enc);
|
||||
|
||||
av_free(data);
|
||||
@@ -429,6 +430,8 @@ static int frame_data_ensure(AVBufferRef **dst, int writable)
|
||||
|
||||
memcpy(fd, fd_src, sizeof(*fd));
|
||||
fd->par_enc = NULL;
|
||||
fd->side_data = NULL;
|
||||
fd->nb_side_data = 0;
|
||||
|
||||
if (fd_src->par_enc) {
|
||||
int ret = 0;
|
||||
@@ -444,6 +447,16 @@ static int frame_data_ensure(AVBufferRef **dst, int writable)
|
||||
}
|
||||
}
|
||||
|
||||
if (fd_src->nb_side_data) {
|
||||
int ret = clone_side_data(&fd->side_data, &fd->nb_side_data,
|
||||
fd_src->side_data, fd_src->nb_side_data, 0);
|
||||
if (ret < 0) {
|
||||
av_buffer_unref(dst);
|
||||
av_buffer_unref(&src);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
av_buffer_unref(&src);
|
||||
} else {
|
||||
fd->dec.frame_num = UINT64_MAX;
|
||||
|
||||
Reference in New Issue
Block a user