mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
Fix variable shadow warnings
This commit is contained in:
@@ -354,6 +354,7 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
|
|||||||
uint32_t offsets[GSR_KMS_MAX_DMA_BUFS];
|
uint32_t offsets[GSR_KMS_MAX_DMA_BUFS];
|
||||||
uint32_t pitches[GSR_KMS_MAX_DMA_BUFS];
|
uint32_t pitches[GSR_KMS_MAX_DMA_BUFS];
|
||||||
uint64_t modifiers[GSR_KMS_MAX_DMA_BUFS];
|
uint64_t modifiers[GSR_KMS_MAX_DMA_BUFS];
|
||||||
|
|
||||||
for(int i = 0; i < drm_fd->num_dma_bufs; ++i) {
|
for(int i = 0; i < drm_fd->num_dma_bufs; ++i) {
|
||||||
fds[i] = drm_fd->dma_buf[i].fd;
|
fds[i] = drm_fd->dma_buf[i].fd;
|
||||||
offsets[i] = drm_fd->dma_buf[i].offset;
|
offsets[i] = drm_fd->dma_buf[i].offset;
|
||||||
@@ -427,10 +428,6 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
|
|||||||
cursor_pos.x += target_x;
|
cursor_pos.x += target_x;
|
||||||
cursor_pos.y += target_y;
|
cursor_pos.y += target_y;
|
||||||
|
|
||||||
int fds[GSR_KMS_MAX_DMA_BUFS];
|
|
||||||
uint32_t offsets[GSR_KMS_MAX_DMA_BUFS];
|
|
||||||
uint32_t pitches[GSR_KMS_MAX_DMA_BUFS];
|
|
||||||
uint64_t modifiers[GSR_KMS_MAX_DMA_BUFS];
|
|
||||||
for(int i = 0; i < cursor_drm_fd->num_dma_bufs; ++i) {
|
for(int i = 0; i < cursor_drm_fd->num_dma_bufs; ++i) {
|
||||||
fds[i] = cursor_drm_fd->dma_buf[i].fd;
|
fds[i] = cursor_drm_fd->dma_buf[i].fd;
|
||||||
offsets[i] = cursor_drm_fd->dma_buf[i].offset;
|
offsets[i] = cursor_drm_fd->dma_buf[i].offset;
|
||||||
|
|||||||
12
src/main.cpp
12
src/main.cpp
@@ -1396,18 +1396,18 @@ static void save_replay_async(AVCodecContext *video_codec_context, int video_str
|
|||||||
audio_track.stream = audio_stream;
|
audio_track.stream = audio_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = avio_open(&av_format_context->pb, save_replay_output_filepath.c_str(), AVIO_FLAG_WRITE);
|
const int open_ret = avio_open(&av_format_context->pb, save_replay_output_filepath.c_str(), AVIO_FLAG_WRITE);
|
||||||
if (ret < 0) {
|
if (open_ret < 0) {
|
||||||
fprintf(stderr, "Error: Could not open '%s': %s. Make sure %s is an existing directory with write access\n", save_replay_output_filepath.c_str(), av_error_to_string(ret), save_replay_output_filepath.c_str());
|
fprintf(stderr, "Error: Could not open '%s': %s. Make sure %s is an existing directory with write access\n", save_replay_output_filepath.c_str(), av_error_to_string(open_ret), save_replay_output_filepath.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVDictionary *options = nullptr;
|
AVDictionary *options = nullptr;
|
||||||
av_dict_set(&options, "strict", "experimental", 0);
|
av_dict_set(&options, "strict", "experimental", 0);
|
||||||
|
|
||||||
ret = avformat_write_header(av_format_context, &options);
|
const int header_write_ret = avformat_write_header(av_format_context, &options);
|
||||||
if (ret < 0) {
|
if (header_write_ret < 0) {
|
||||||
fprintf(stderr, "Error occurred when writing header to output file: %s\n", av_error_to_string(ret));
|
fprintf(stderr, "Error occurred when writing header to output file: %s\n", av_error_to_string(header_write_ret));
|
||||||
avio_close(av_format_context->pb);
|
avio_close(av_format_context->pb);
|
||||||
avformat_free_context(av_format_context);
|
avformat_free_context(av_format_context);
|
||||||
av_dict_free(&options);
|
av_dict_free(&options);
|
||||||
|
|||||||
Reference in New Issue
Block a user