Skip to content

Commit

Permalink
fix: fixed syntax issues for MSVC
Browse files Browse the repository at this point in the history
Signed-off-by: k4yt3x <i@k4yt3x.com>
  • Loading branch information
k4yt3x committed Oct 9, 2024
1 parent c48b4ed commit c023595
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/libvideo2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct LibplaceboConfig {
// Configuration for RealESRGAN filter
struct RealESRGANConfig {
int gpuid;
int tta_mode;
bool tta_mode;
int scaling_factor;
const char *model;
};
Expand Down
10 changes: 5 additions & 5 deletions src/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int encode_and_write_frame(

ret = avcodec_send_frame(enc_ctx, frame);
if (ret < 0) {
fprintf(stderr, "Error sending frame to encoder: %s\n", av_err2str(ret));
fprintf(stderr, "Error sending frame to encoder\n");
av_packet_free(&enc_pkt);
return ret;
}
Expand All @@ -212,7 +212,7 @@ int encode_and_write_frame(
av_packet_unref(enc_pkt);
break;
} else if (ret < 0) {
fprintf(stderr, "Error during encoding: %s\n", av_err2str(ret));
fprintf(stderr, "Error encoding frame\n");
av_packet_free(&enc_pkt);
return ret;
}
Expand All @@ -225,7 +225,7 @@ int encode_and_write_frame(
ret = av_interleaved_write_frame(ofmt_ctx, enc_pkt);
av_packet_unref(enc_pkt);
if (ret < 0) {
fprintf(stderr, "Error muxing packet: %s\n", av_err2str(ret));
fprintf(stderr, "Error muxing packet\n");
av_packet_free(&enc_pkt);
return ret;
}
Expand All @@ -250,7 +250,7 @@ int flush_encoder(AVCodecContext *enc_ctx, AVFormatContext *ofmt_ctx) {
av_packet_unref(enc_pkt);
break;
} else if (ret < 0) {
fprintf(stderr, "Error during encoding: %s\n", av_err2str(ret));
fprintf(stderr, "Error encoding frame\n");
av_packet_free(&enc_pkt);
return ret;
}
Expand All @@ -263,7 +263,7 @@ int flush_encoder(AVCodecContext *enc_ctx, AVFormatContext *ofmt_ctx) {
ret = av_interleaved_write_frame(ofmt_ctx, enc_pkt);
av_packet_unref(enc_pkt);
if (ret < 0) {
fprintf(stderr, "Error muxing packet: %s\n", av_err2str(ret));
fprintf(stderr, "Error muxing packet\n");
av_packet_free(&enc_pkt);
return ret;
}
Expand Down
10 changes: 5 additions & 5 deletions src/libvideo2x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int process_frames(
// If copy streams is enabled, copy the packet to the output
ret = av_interleaved_write_frame(ofmt_ctx, &packet);
if (ret < 0) {
fprintf(stderr, "Error muxing packet: %s\n", av_err2str(ret));
fprintf(stderr, "Error muxing packet\n");
av_packet_unref(&packet);
return ret;
}
Expand Down Expand Up @@ -338,9 +338,9 @@ extern "C" int process_video(
return -1;
}

filter = new LibplaceboFilter(
filter = new LibplaceboFilter{
config.output_width, config.output_height, std::filesystem::path(config.shader_path)
);
};
break;
}
case FILTER_REALESRGAN: {
Expand All @@ -360,9 +360,9 @@ extern "C" int process_video(
return -1;
}

filter = new RealesrganFilter(
filter = new RealesrganFilter{
config.gpuid, config.tta_mode, config.scaling_factor, config.model
);
};
break;
}
default:
Expand Down

0 comments on commit c023595

Please sign in to comment.