AVStream *avstream_video = avformat_new_stream(avctx, nullptr);
if (avstream_video == nullptr) {
fprintf(stderr, "avformat_new_stream() failed\n");
- exit(1);
+ abort();
}
avstream_video->time_base = AVRational{1, time_base};
avstream_video->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
AVStream *avstream_audio = avformat_new_stream(avctx, nullptr);
if (avstream_audio == nullptr) {
fprintf(stderr, "avformat_new_stream() failed\n");
- exit(1);
+ abort();
}
avstream_audio->time_base = AVRational{1, time_base};
if (avcodec_parameters_copy(avstream_audio->codecpar, audio_codecpar) < 0) {
fprintf(stderr, "avcodec_parameters_copy() failed\n");
- exit(1);
+ abort();
}
streams.push_back(avstream_audio);
}
AVStream *avstream_subtitles = avformat_new_stream(avctx, nullptr);
if (avstream_subtitles == nullptr) {
fprintf(stderr, "avformat_new_stream() failed\n");
- exit(1);
+ abort();
}
avstream_subtitles->time_base = AVRational{1, time_base};
avstream_subtitles->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
}
if (avformat_write_header(avctx, &options) < 0) {
fprintf(stderr, "avformat_write_header() failed\n");
- exit(1);
+ abort();
}
for (MuxMetrics *metric : metrics) {
metric->metric_written_bytes += avctx->pb->pos;
av_init_packet(&pkt_copy);
if (av_packet_ref(&pkt_copy, &pkt) < 0) {
fprintf(stderr, "av_copy_packet() failed\n");
- exit(1);
+ abort();
}
if (stream_index_override != -1) {
pkt_copy.stream_index = stream_index_override;