throw runtime_error (String::compose ("could not open FFmpeg audio codec (%1)", buffer));
}
- if (avio_open_boost (&_format_context->pb, _output, AVIO_FLAG_WRITE) < 0) {
- throw runtime_error ("could not open FFmpeg output file");
+ r = avio_open_boost (&_format_context->pb, _output, AVIO_FLAG_WRITE);
+ if (r < 0) {
+ throw runtime_error (String::compose("could not open FFmpeg output file %1 (%2)", _output.string(), r));
}
AVDictionary* options = 0;
DCPOMATIC_ASSERT (false);
}
- frame->pts = _audio_frames / (av_q2d (_audio_stream->time_base) * _audio_frame_rate);
+ DCPOMATIC_ASSERT (_audio_stream->time_base.num == 1);
+ frame->pts = _audio_frames * _audio_stream->time_base.den / _audio_frame_rate;
AVPacket packet;
av_init_packet (&packet);