Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
github-clones
Performous
Commits
01eee186
Commit
01eee186
authored
Apr 18, 2020
by
Sébastien Gonzalve
Committed by
Arjan Spieard
Jun 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move nullness check to where it is useful
parent
64789fa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
game/ffmpeg.cc
game/ffmpeg.cc
+1
-1
No files found.
game/ffmpeg.cc
View file @
01eee186
...
...
@@ -304,6 +304,7 @@ void FFmpeg::open() {
case
AVMEDIA_TYPE_AUDIO
:
m_rate
=
audioBuffer
->
getSamplesPerSecond
()
/
double
(
AUDIO_CHANNELS
);
m_resampleContext
.
reset
(
swr_alloc
());
if
(
!
m_resampleContext
)
throw
std
::
runtime_error
(
"Cannot create resampling context"
);
av_opt_set_int
(
m_resampleContext
.
get
(),
"in_channel_layout"
,
m_codecContext
->
channel_layout
?
m_codecContext
->
channel_layout
:
av_get_default_channel_layout
(
m_codecContext
->
channels
),
0
);
av_opt_set_int
(
m_resampleContext
.
get
(),
"out_channel_layout"
,
av_get_default_channel_layout
(
AUDIO_CHANNELS
),
0
);
av_opt_set_int
(
m_resampleContext
.
get
(),
"in_sample_rate"
,
m_codecContext
->
sample_rate
,
0
);
...
...
@@ -311,7 +312,6 @@ void FFmpeg::open() {
av_opt_set_int
(
m_resampleContext
.
get
(),
"in_sample_fmt"
,
m_codecContext
->
sample_fmt
,
0
);
av_opt_set_int
(
m_resampleContext
.
get
(),
"out_sample_fmt"
,
AV_SAMPLE_FMT_S16
,
0
);
swr_init
(
m_resampleContext
.
get
());
if
(
!
m_resampleContext
)
throw
std
::
runtime_error
(
"Cannot create resampling context"
);
break
;
case
AVMEDIA_TYPE_VIDEO
:
// Setup software scaling context for YUV to RGB conversion
...
...
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