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
ebfbb74f
Commit
ebfbb74f
authored
Aug 24, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/ffmpeg/DetectFilterFormat: return AudioFormat::Undefined() on EAGAIN
parent
7b4225aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
FfmpegFilterPlugin.cxx
src/filter/plugins/FfmpegFilterPlugin.cxx
+3
-0
DetectFilterFormat.cxx
src/lib/ffmpeg/DetectFilterFormat.cxx
+7
-1
DetectFilterFormat.hxx
src/lib/ffmpeg/DetectFilterFormat.hxx
+3
-0
No files found.
src/filter/plugins/FfmpegFilterPlugin.cxx
View file @
ebfbb74f
...
...
@@ -54,6 +54,9 @@ PreparedFfmpegFilter::Open(AudioFormat &in_audio_format)
Ffmpeg
::
DetectFilterOutputFormat
(
in_audio_format
,
buffer_src
,
buffer_sink
);
if
(
!
out_audio_format
.
IsDefined
())
throw
std
::
runtime_error
(
"Unable to determine FFmpeg filter output format"
);
return
std
::
make_unique
<
FfmpegFilter
>
(
in_audio_format
,
out_audio_format
,
std
::
move
(
graph
),
...
...
src/lib/ffmpeg/DetectFilterFormat.cxx
View file @
ebfbb74f
...
...
@@ -62,8 +62,14 @@ DetectFilterOutputFormat(const AudioFormat &in_audio_format,
frame
.
Unref
();
err
=
av_buffersink_get_frame
(
&
buffer_sink
,
frame
.
get
());
if
(
err
<
0
)
if
(
err
<
0
)
{
if
(
err
==
AVERROR
(
EAGAIN
))
/* one sample was not enough input data for
the given filter graph */
return
AudioFormat
::
Undefined
();
throw
MakeFfmpegError
(
err
,
"av_buffersink_get_frame() failed"
);
}
const
SampleFormat
sample_format
=
FromFfmpegSampleFormat
(
AVSampleFormat
(
frame
->
format
));
if
(
sample_format
==
SampleFormat
::
UNDEFINED
)
...
...
src/lib/ffmpeg/DetectFilterFormat.hxx
View file @
ebfbb74f
...
...
@@ -35,6 +35,9 @@ namespace Ffmpeg {
* between.
*
* This function can throw if the FFmpeg filter fails.
*
* @return the output format or AudioFormat::Undefined() if it was not
* possible to determine the format
*/
AudioFormat
DetectFilterOutputFormat
(
const
AudioFormat
&
in_audio_format
,
...
...
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