Skip to content

Commit

Permalink
[CHORE:CI] taking address of temporary array issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nots1dd committed Feb 23, 2025
1 parent 8d711ee commit bc6f084
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,13 @@ class HLS_Encoder
// Open input file
if ((ret = avformat_open_input(&input_ctx, input_file, nullptr, nullptr)) < 0)
{
av_log(nullptr, AV_LOG_ERROR, "Error opening input file.");
av_log(nullptr, AV_LOG_ERROR, "Error opening input file.\n");
return ret;
}

if ((ret = avformat_find_stream_info(input_ctx, nullptr)) < 0)
{
av_log(nullptr, AV_LOG_ERROR, "Error finding stream info.");
av_log(nullptr, AV_LOG_ERROR, "Error finding stream info.\n");
goto cleanup;
}

Expand All @@ -270,7 +270,7 @@ class HLS_Encoder

if (audio_stream_idx == -1)
{
fprintf(stderr, "No audio stream found\n");
av_log(nullptr, AV_LOG_ERROR, "No audio stream found.\n");
ret = AVERROR(EINVAL);
goto cleanup;
}
Expand Down Expand Up @@ -306,7 +306,7 @@ class HLS_Encoder
in_stream = input_ctx->streams[audio_stream_idx];
if ((ret = avcodec_parameters_copy(out_stream->codecpar, in_stream->codecpar)) < 0)
{
fprintf(stderr, "Error copying codec parameters: %s\n", av_err2str(ret));
av_log(nullptr, AV_LOG_ERROR, "Error copying codec parameters.\n");
goto cleanup;
}

Expand All @@ -315,23 +315,23 @@ class HLS_Encoder
{
if ((ret = avio_open(&output_ctx->pb, output_ctx->url, AVIO_FLAG_WRITE)) < 0)
{
fprintf(stderr, "Error opening output file: %s\n", av_err2str(ret));
av_log(nullptr, AV_LOG_ERROR, "Error opening output file.\n");
goto cleanup;
}
}

// Write header
if ((ret = avformat_write_header(output_ctx, nullptr)) < 0)
{
fprintf(stderr, "Error writing header: %s\n", av_err2str(ret));
av_log(nullptr, AV_LOG_ERROR, "Error writing header.\n");
goto cleanup;
}

// Allocate packet
pkt = av_packet_alloc();
if (!pkt)
{
fprintf(stderr, "Error allocating packet\n");
av_log(nullptr, AV_LOG_ERROR, "Error allocating packet\n");
ret = AVERROR(ENOMEM);
goto cleanup;
}
Expand All @@ -351,7 +351,7 @@ class HLS_Encoder

if ((ret = av_interleaved_write_frame(output_ctx, pkt)) < 0)
{
fprintf(stderr, "Error writing packet: %s\n", av_err2str(ret));
av_log(nullptr, AV_LOG_ERROR, "Error writing packet.\n");
break;
}
}
Expand Down Expand Up @@ -433,11 +433,11 @@ auto main(int argc, char* argv[]) -> int
{
if (fs::create_directory(output_dir))
{
std::cout << "Directory created successfully: " << output_dir << std::endl;
LOG_INFO << "-- Directory created successfully: " << output_dir << std::endl;
}
else
{
std::cerr << "Failed to create directory: " << output_dir << std::endl;
LOG_ERROR << "Failed to create directory: " << output_dir << std::endl;
}
}

Expand Down

0 comments on commit bc6f084

Please sign in to comment.