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
817int enc_alloc(Encoder **penc, const AVCodec *codec);817int enc_alloc(Encoder **penc, const AVCodec *codec);
818void enc_free(Encoder **penc);818void enc_free(Encoder **penc);
819 819
820int enc_open(OutputStream *ost, AVFrame *frame);820int enc_open(OutputStream *ost, const AVFrame *frame);
821int enc_subtitle(OutputFile *of, OutputStream *ost, const AVSubtitle *sub);821int enc_subtitle(OutputFile *of, OutputStream *ost, const AVSubtitle *sub);
822int enc_frame(OutputStream *ost, AVFrame *frame);822int enc_frame(OutputStream *ost, AVFrame *frame);
823int enc_flush(void);823int 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
165 return 0;165 return 0;
166}166}
167 167
168int enc_open(OutputStream *ost, AVFrame *frame)168int enc_open(OutputStream *ost, const AVFrame *frame)
169{169{
170 InputStream *ist = ost->ist;170 InputStream *ist = ost->ist;
171 Encoder *e = ost->enc;171 Encoder *e = ost->enc;
@@ -183,9 +183,8 @@ int enc_open(OutputStream *ost, AVFrame *frame) · 11 unmodified lines
183 av_assert0(frame || (enc->type != AVMEDIA_TYPE_VIDEO && enc->type != AVMEDIA_TYPE_AUDIO));183 av_assert0(frame || (enc->type != AVMEDIA_TYPE_VIDEO && enc->type != AVMEDIA_TYPE_AUDIO));
184 184
185 if (frame) {185 if (frame) {
186 fd = frame_data(frame);186 av_assert0(frame->opaque_ref);
187 if (!fd)187 fd = (FrameData*)frame->opaque_ref->data;
188 return AVERROR(ENOMEM);
189 }188 }
190 189
191 ret = set_encoder_id(output_files[ost->file_index], ost);190 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