]> git.sesse.net Git - nageru/blobdiff - nageru/audio_encoder.cpp
Remove the web_security flag for newer CEF, since it is no longer available (https...
[nageru] / nageru / audio_encoder.cpp
index 0f7f9aac8c957e3d686c87daa863719d102982d1..61ddfffcb80fc38cd69d6e1031686addde49dd8a 100644 (file)
@@ -29,7 +29,7 @@ using namespace std;
 
 AudioEncoder::AudioEncoder(const string &codec_name, int bit_rate, const AVOutputFormat *oformat)
 {
-       AVCodec *codec = avcodec_find_encoder_by_name(codec_name.c_str());
+       const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.c_str());
        if (codec == nullptr) {
                fprintf(stderr, "ERROR: Could not find codec '%s'\n", codec_name.c_str());
                abort();
@@ -110,6 +110,7 @@ void AudioEncoder::encode_audio_one_frame(const float *audio, size_t num_samples
 {
        audio_frame->pts = audio_pts;
        audio_frame->nb_samples = num_samples;
+       audio_frame->channels = 2;
        audio_frame->channel_layout = AV_CH_LAYOUT_STEREO;
        audio_frame->format = ctx->sample_fmt;
        audio_frame->sample_rate = OUTPUT_FREQUENCY;