From 728bffa6a051354510941f3142984193229e3726 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 29 Apr 2016 08:52:25 -0400 Subject: [PATCH] Check and set audio to mono --- src/zm_videostore.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index 8357ba5f7..b52f5ea2b 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -107,6 +107,10 @@ VideoStore::VideoStore(const char *filename_in, const char *format_in, Fatal("Unable to copy audio context %s\n", av_make_error_string(ret).c_str()); } audio_st->codec->codec_tag = 0; + if ( audio_st->codec->channels > 1 ) { + Warning("Audio isn't mono, changing it."); + audio_st->codec->channels = 1; + } if (oc->oformat->flags & AVFMT_GLOBALHEADER) { audio_st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; }