- if (global_flags.uncompressed_video_to_http) {
- add_packet_for_uncompressed_frame(pts, duration, data);
- } else if (global_flags.x264_video_to_http || global_flags.x264_video_to_disk) {
- x264_http_encoder->add_frame(pts, duration, frame.ycbcr_coefficients, data, received_ts);
- }
- if (global_flags.x264_separate_disk_encode) {
- x264_disk_encoder->add_frame(pts, duration, frame.ycbcr_coefficients, data, received_ts);
+ if (http_encoder != nullptr) {
+ http_encoder->add_frame(pts, duration, frame.ycbcr_coefficients, data, received_ts);
+ } if (disk_encoder != nullptr && disk_encoder != http_encoder) {
+ disk_encoder->add_frame(pts, duration, frame.ycbcr_coefficients, data, received_ts);