Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
7c920dde
Commit
7c920dde
authored
Aug 08, 2022
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter/ffmpeg: fix FFmpeg 5.1 deprecation warnings
parent
bbc088ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
FfmpegFilter.cxx
src/filter/plugins/FfmpegFilter.cxx
+9
-0
FfmpegFilter.hxx
src/filter/plugins/FfmpegFilter.hxx
+7
-1
DetectFilterFormat.cxx
src/lib/ffmpeg/DetectFilterFormat.cxx
+11
-1
No files found.
src/filter/plugins/FfmpegFilter.cxx
View file @
7c920dde
...
...
@@ -40,10 +40,15 @@ FfmpegFilter::FfmpegFilter(const AudioFormat &in_audio_format,
buffer_sink
(
_buffer_sink
),
in_format
(
Ffmpeg
::
ToFfmpegSampleFormat
(
in_audio_format
.
format
)),
in_sample_rate
(
in_audio_format
.
sample_rate
),
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(57, 25, 100)
in_channels
(
in_audio_format
.
channels
),
#endif
in_audio_frame_size
(
in_audio_format
.
GetFrameSize
()),
out_audio_frame_size
(
_out_audio_format
.
GetFrameSize
())
{
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
av_channel_layout_default
(
&
in_ch_layout
,
in_audio_format
.
channels
);
#endif
}
ConstBuffer
<
void
>
...
...
@@ -54,7 +59,11 @@ FfmpegFilter::FilterPCM(ConstBuffer<void> src)
frame
.
Unref
();
frame
->
format
=
in_format
;
frame
->
sample_rate
=
in_sample_rate
;
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
frame
->
ch_layout
=
in_ch_layout
;
#else
frame
->
channels
=
in_channels
;
#endif
frame
->
nb_samples
=
src
.
size
/
in_audio_frame_size
;
frame
.
GetBuffer
();
...
...
src/filter/plugins/FfmpegFilter.hxx
View file @
7c920dde
...
...
@@ -35,7 +35,13 @@ class FfmpegFilter final : public Filter {
FfmpegBuffer
interleave_buffer
;
const
int
in_format
,
in_sample_rate
,
in_channels
;
const
int
in_format
,
in_sample_rate
;
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
AVChannelLayout
in_ch_layout
;
#else
const
int
in_channels
;
#endif
const
size_t
in_audio_frame_size
;
const
size_t
out_audio_frame_size
;
...
...
src/lib/ffmpeg/DetectFilterFormat.cxx
View file @
7c920dde
...
...
@@ -48,7 +48,11 @@ DetectFilterOutputFormat(const AudioFormat &in_audio_format,
Frame
frame
;
frame
->
format
=
ToFfmpegSampleFormat
(
in_audio_format
.
format
);
frame
->
sample_rate
=
in_audio_format
.
sample_rate
;
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
av_channel_layout_default
(
&
frame
->
ch_layout
,
in_audio_format
.
channels
);
#else
frame
->
channels
=
in_audio_format
.
channels
;
#endif
frame
->
nb_samples
=
1
;
frame
.
GetBuffer
();
...
...
@@ -75,8 +79,14 @@ DetectFilterOutputFormat(const AudioFormat &in_audio_format,
if
(
sample_format
==
SampleFormat
::
UNDEFINED
)
throw
std
::
runtime_error
(
"Unsupported FFmpeg sample format"
);
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 25, 100)
const
unsigned
out_channels
=
frame
->
ch_layout
.
nb_channels
;
#else
const
unsigned
out_channels
=
frame
->
channels
;
#endif
return
CheckAudioFormat
(
frame
->
sample_rate
,
sample_format
,
frame
->
channels
);
out_
channels
);
}
}
// namespace Ffmpeg
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment