Check and set audio to mono

This commit is contained in:
Isaac Connor 2016-04-29 08:52:25 -04:00
parent af66105c37
commit 728bffa6a0
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}