fftools/ffmpeg: factor out attaching FrameData to a frame

Will be useful in following commits.
This commit is contained in:
Anton Khirnov
2023-05-27 12:25:51 +02:00
parent d7781cfb95
commit 9630341073
3 changed files with 19 additions and 3 deletions

View File

@@ -431,6 +431,17 @@ InputStream *ist_iter(InputStream *prev)
return NULL;
}
FrameData *frame_data(AVFrame *frame)
{
if (!frame->opaque_ref) {
frame->opaque_ref = av_buffer_allocz(sizeof(FrameData));
if (!frame->opaque_ref)
return NULL;
}
return (FrameData*)frame->opaque_ref->data;
}
void remove_avoptions(AVDictionary **a, AVDictionary *b)
{
const AVDictionaryEntry *t = NULL;