From b51d885f6617d0cc3f2a9e9d1be5a1cb950d6f15 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 14 Jun 2017 10:36:08 -0400 Subject: [PATCH 1/2] fix build on old ffmpeg --- src/zm_ffmpeg.cpp | 3 ++- src/zm_ffmpeg.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp index 5a90c78fc..2dab1538d 100644 --- a/src/zm_ffmpeg.cpp +++ b/src/zm_ffmpeg.cpp @@ -413,6 +413,7 @@ static void zm_log_fps(double d, const char *postfix) { Debug(1, "%1.0fk %s", d / 1000, postfix); } +#if LIBAVCODEC_VERSION_CHECK(57, 0, 0, 0, 0) void zm_dump_codecpar ( const AVCodecParameters *par ) { Debug(1, "Dumping codecpar codec_type(%d) codec_id(%d) codec_tag(%d) width(%d) height(%d)", par->codec_type, @@ -422,6 +423,7 @@ void zm_dump_codecpar ( const AVCodecParameters *par ) { par->height ); } +#endif void zm_dump_codec ( const AVCodecContext *codec ) { Debug(1, "Dumping codecpar codec_type(%d) codec_id(%d) width(%d) height(%d)", @@ -432,7 +434,6 @@ void zm_dump_codec ( const AVCodecContext *codec ) { ); } - /* "user interface" functions */ void zm_dump_stream_format(AVFormatContext *ic, int i, int index, int is_output) { char buf[256]; diff --git a/src/zm_ffmpeg.h b/src/zm_ffmpeg.h index 772b3db2e..c94006edb 100644 --- a/src/zm_ffmpeg.h +++ b/src/zm_ffmpeg.h @@ -324,7 +324,9 @@ static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, in void zm_dump_stream_format(AVFormatContext *ic, int i, int index, int is_output); void zm_dump_codec ( const AVCodecContext *codec ); +#if LIBAVCODEC_VERSION_CHECK(57, 0, 0, 0, 0) void zm_dump_codecpar ( const AVCodecParameters *par ); +#endif #if LIBAVCODEC_VERSION_CHECK(56, 8, 0, 60, 100) #define zm_av_packet_unref( packet ) av_packet_unref( packet ) From a4b3f6b41a5dc562e41d4b7fbb9e61dace1715e1 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 14 Jun 2017 10:54:21 -0400 Subject: [PATCH 2/2] fix form of delete used --- src/zm_zone.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_zone.cpp b/src/zm_zone.cpp index 7430f2498..8e3b90098 100644 --- a/src/zm_zone.cpp +++ b/src/zm_zone.cpp @@ -792,7 +792,7 @@ bool Zone::ParseZoneString( const char *zone_string, int &zone_id, int &colour, zone_id = strtol( str, 0, 10 ); Debug( 3, "Got zone %d from zone string", zone_id ); if ( !ws ) { - delete str_ptr; + delete[] str_ptr; return( true ); } @@ -806,7 +806,7 @@ bool Zone::ParseZoneString( const char *zone_string, int &zone_id, int &colour, colour = strtol( str, 0, 16 ); Debug( 3, "Got colour %06x from zone string", colour ); if ( !ws ) { - delete str_ptr; + delete[] str_ptr; return( true ); } *ws = '\0';