History

fftools/ffmpeg_enc: constify the frame passed to enc_open()

Anton Khirnov committed 3 years ago

Commit 33f058f1 parent 2ef50c12 files · +4 −5Browse files

Unified · Split

2 files
  1. fftools/ffmpeg.h +1 −1
  2. fftools/ffmpeg_enc.c +3 −4
fftools/ffmpeg.h+1−1
@@ -817,7 +817,7 @@ int dec_packet(InputStream *ist, const AVPacket *pkt, int no_eof); · 816 unmodified lines
817817 int enc_alloc(Encoder **penc, const AVCodec *codec);
818818 void enc_free(Encoder **penc);
819819
820−int enc_open(OutputStream *ost, AVFrame *frame);
820+int enc_open(OutputStream *ost, const AVFrame *frame);
821821 int enc_subtitle(OutputFile *of, OutputStream *ost, const AVSubtitle *sub);
822822 int enc_frame(OutputStream *ost, AVFrame *frame);
823823 int enc_flush(void);
fftools/ffmpeg_enc.c+3−4
@@ -165,7 +165,7 @@ static int set_encoder_id(OutputFile *of, OutputStream *ost) · 164 unmodified lines
165165 return 0;
166166 }
167167
168−int enc_open(OutputStream *ost, AVFrame *frame)
168+int enc_open(OutputStream *ost, const AVFrame *frame)
169169 {
170170 InputStream *ist = ost->ist;
171171 Encoder *e = ost->enc;
@@ -183,9 +183,8 @@ int enc_open(OutputStream *ost, AVFrame *frame) · 11 unmodified lines
183183 av_assert0(frame || (enc->type != AVMEDIA_TYPE_VIDEO && enc->type != AVMEDIA_TYPE_AUDIO));
184184
185185 if (frame) {
186− fd = frame_data(frame);
187− if (!fd)
188− return AVERROR(ENOMEM);
186+ av_assert0(frame->opaque_ref);
187+ fd = (FrameData*)frame->opaque_ref->data;
189188 }
190189
191190 ret = set_encoder_id(output_files[ost->file_index], ost);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t