Skip to content

Commit e1b474e

Browse files
authored
Silence deprecated warnings in ffmpeg 3.x
1 parent c55d855 commit e1b474e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/FFmpegWriter.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,14 @@ AVStream *FFmpegWriter::add_audio_stream() {
992992
throw InvalidCodec("A valid audio codec could not be found for this file.", path);
993993

994994
// Create a new audio stream
995+
#if (IS_FFMPEG_3_2 && (LIBAVFORMAT_VERSION_MAJOR < 58))
996+
_Pragma ("GCC diagnostic push")
997+
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
998+
#endif
995999
AV_FORMAT_NEW_STREAM(oc, audio_codec, codec, st)
1000+
#if (IS_FFMPEG_3_2 && (LIBAVFORMAT_VERSION_MAJOR < 58))
1001+
_Pragma ("GCC diagnostic pop")
1002+
#endif
9961003

9971004
c->codec_id = codec->id;
9981005
#if LIBAVFORMAT_VERSION_MAJOR >= 53
@@ -1075,7 +1082,14 @@ AVStream *FFmpegWriter::add_video_stream() {
10751082
throw InvalidCodec("A valid video codec could not be found for this file.", path);
10761083

10771084
// Create a new video stream
1085+
#if (IS_FFMPEG_3_2 && (LIBAVFORMAT_VERSION_MAJOR < 58))
1086+
_Pragma ("GCC diagnostic push")
1087+
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
1088+
#endif
10781089
AV_FORMAT_NEW_STREAM(oc, video_codec, codec, st)
1090+
#if (IS_FFMPEG_3_2 && (LIBAVFORMAT_VERSION_MAJOR < 58))
1091+
_Pragma ("GCC diagnostic pop")
1092+
#endif
10791093

10801094
c->codec_id = codec->id;
10811095
#if LIBAVFORMAT_VERSION_MAJOR >= 53

0 commit comments

Comments
 (0)