Skip to content

Commit c54a370

Browse files
authored
Update FFmpegUtilities.h
Warnings are now silenced in FFmpegUtilities.h, where it should be.
1 parent 40b9891 commit c54a370

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/FFmpegUtilities.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,12 @@
209209
#define AV_FORMAT_NEW_STREAM(oc, st_codec, av_codec, av_st) av_st = avformat_new_stream(oc, NULL);\
210210
if (!av_st) \
211211
throw OutOfMemory("Could not allocate memory for the video stream.", path); \
212-
c = avcodec_alloc_context3(av_codec); \
213-
st_codec = c; \
214-
av_st->codecpar->codec_id = av_codec->id;
212+
_Pragma ("GCC diagnostic push"); \
213+
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\""); \
214+
avcodec_get_context_defaults3(av_st->codec, av_codec); \
215+
c = av_st->codec; \
216+
_Pragma ("GCC diagnostic pop"); \
217+
st_codec = c;
215218
#define AV_COPY_PARAMS_FROM_CONTEXT(av_stream, av_codec) avcodec_parameters_from_context(av_stream->codecpar, av_codec);
216219
#elif LIBAVFORMAT_VERSION_MAJOR >= 55
217220
#define AV_REGISTER_ALL av_register_all();

0 commit comments

Comments
 (0)