Skip to content

Commit

Permalink
Make suggested changes
Browse files Browse the repository at this point in the history
 - check for av_find_best_stream() AVCodec pointer constness correctly
 - do no split expression in ffmpeg_utility.cpp with a preprocessor macro
  • Loading branch information
jovaska1337 committed Feb 24, 2025
1 parent 3fa287a commit 743fa48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,10 @@ SwresamplePointer MakeSwresamplePointer(
}

// Initialize audio resampler
AvErrorWrap error;
#if DA_FFMPEG_NEW_CHANNEL_LAYOUT
auto result = (SwrContext*)nullptr;
auto error = AvErrorWrap(swr_alloc_set_opts2(
error = AvErrorWrap(swr_alloc_set_opts2(
&result,
dstLayout,
dstFormat,
Expand Down Expand Up @@ -576,7 +577,6 @@ SwresamplePointer MakeSwresamplePointer(
if (!result) {
LogError(u"swr_alloc_set_opts"_q);
}
auto
#endif // DA_FFMPEG_NEW_CHANNEL_LAYOUT

error = AvErrorWrap(swr_init(result));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ constexpr auto kFrameSize = 4096;
}


#if DA_FFMPEG_NEW_CHANNEL_LAYOUT
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 79, 100)
auto inCodec = (const AVCodec*)nullptr;
#else
auto inCodec = (AVCodec*)nullptr;
Expand Down

0 comments on commit 743fa48

Please sign in to comment.