extern "C" {
#include <libavformat/avformat.h>
+#include <libavutil/channel_layout.h>
}
using namespace std;
avstream_audio->time_base = AVRational{ 1, TIMEBASE };
avstream_audio->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
avstream_audio->codecpar->codec_id = AV_CODEC_ID_PCM_S32LE;
- avstream_audio->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
- avstream_audio->codecpar->channels = 2;
+ avstream_audio->codecpar->ch_layout.order = AV_CHANNEL_ORDER_NATIVE;
+ avstream_audio->codecpar->ch_layout.nb_channels = 2;
+ avstream_audio->codecpar->ch_layout.u.mask = AV_CH_LAYOUT_STEREO;
avstream_audio->codecpar->sample_rate = OUTPUT_FREQUENCY;
audio_streams.push_back(avstream_audio);
}
}
}
- FrameReader::Frame frame = readers[first_frame_stream_idx].read_frame(first_frame, /*read_audio=*/true);
+ FrameReader::Frame frame = readers[first_frame_stream_idx].read_frame(first_frame, /*read_video=*/true, /*read_audio=*/true);
// Write audio. (Before video, since that's what we expect on input.)
if (!frame.audio.empty()) {