summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-09-14 18:00:40 +0200
committerAnton Khirnov <anton@khirnov.net>2023-10-10 12:41:31 +0200
commit33f058f2ecede72de13c2de8267f65ff625cda09 (patch)
tree1ae1144d32d22d21c2dd52b8aee0a9bbe3249474 /fftools/ffmpeg_enc.c
parent2ef50c17ab5aff95fc5372b6041c6fc835cac62b (diff)
fftools/ffmpeg_enc: constify the frame passed to enc_open()
Diffstat (limited to 'fftools/ffmpeg_enc.c')
-rw-r--r--fftools/ffmpeg_enc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index abcf2deb2d..fa4539664f 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -165,7 +165,7 @@ static int set_encoder_id(OutputFile *of, OutputStream *ost)
return 0;
}
-int enc_open(OutputStream *ost, AVFrame *frame)
+int enc_open(OutputStream *ost, const AVFrame *frame)
{
InputStream *ist = ost->ist;
Encoder *e = ost->enc;
@@ -183,9 +183,8 @@ int enc_open(OutputStream *ost, AVFrame *frame)
av_assert0(frame || (enc->type != AVMEDIA_TYPE_VIDEO && enc->type != AVMEDIA_TYPE_AUDIO));
if (frame) {
- fd = frame_data(frame);
- if (!fd)
- return AVERROR(ENOMEM);
+ av_assert0(frame->opaque_ref);
+ fd = (FrameData*)frame->opaque_ref->data;
}
ret = set_encoder_id(output_files[ost->file_index], ost);