Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
d9c2c093
Commit
d9c2c093
authored
Aug 28, 2006
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to reopen the audio encoder when channels dimensions have changed.
parent
bf490f9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
+31
-8
modules/stream_out/transcode.c
modules/stream_out/transcode.c
+31
-8
No files found.
modules/stream_out/transcode.c
View file @
d9c2c093
...
...
@@ -1333,7 +1333,7 @@ static int transcode_audio_new( sout_stream_t *p_stream,
{
msg_Err
(
p_stream
,
"cannot find encoder (%s)"
,
p_sys
->
psz_aenc
);
module_Unneed
(
id
->
p_decoder
,
id
->
p_decoder
->
p_module
);
id
->
p_decoder
->
p_module
=
0
;
id
->
p_decoder
->
p_module
=
NULL
;
return
VLC_EGENERIC
;
}
id
->
p_encoder
->
fmt_in
.
audio
.
i_format
=
id
->
p_encoder
->
fmt_in
.
i_codec
;
...
...
@@ -1399,11 +1399,11 @@ static int transcode_audio_new( sout_stream_t *p_stream,
if
(
fmt_last
.
audio
.
i_channels
!=
id
->
p_encoder
->
fmt_in
.
audio
.
i_channels
)
{
msg_Err
(
p_stream
,
"no audio filter found for mixing from"
" %i to %i channels"
,
fmt_last
.
audio
.
i_channels
,
id
->
p_encoder
->
fmt_in
.
audio
.
i_channels
)
;
#if 0
/*
FIXME : t
his might work, but only if the encoder is restarted */
#if 1
module_Unneed
(
id
->
p_encoder
,
id
->
p_encoder
->
p_module
);
id
->
p_encoder
->
p_module
=
NULL
;
/*
T
his might work, but only if the encoder is restarted */
id
->
p_encoder
->
fmt_in
.
audio
.
i_channels
=
fmt_last
.
audio
.
i_channels
;
id
->
p_encoder
->
fmt_out
.
audio
.
i_channels
=
fmt_last
.
audio
.
i_channels
;
...
...
@@ -1413,7 +1413,30 @@ static int transcode_audio_new( sout_stream_t *p_stream,
id
->
p_encoder
->
fmt_out
.
audio
.
i_physical_channels
=
id
->
p_encoder
->
fmt_out
.
audio
.
i_original_channels
=
fmt_last
.
audio
.
i_physical_channels
;
msg_Dbg
(
p_stream
,
"number of audio channels for mixing changed, "
"trying to reopen the encoder for mixing %i to %i channels"
,
fmt_last
.
audio
.
i_channels
,
id
->
p_encoder
->
fmt_in
.
audio
.
i_channels
);
/* reload encoder */
id
->
p_encoder
->
p_cfg
=
p_stream
->
p_sys
->
p_audio_cfg
;
id
->
p_encoder
->
p_module
=
module_Need
(
id
->
p_encoder
,
"encoder"
,
p_sys
->
psz_aenc
,
VLC_TRUE
);
if
(
!
id
->
p_encoder
->
p_module
)
{
msg_Err
(
p_stream
,
"cannot find encoder (%s)"
,
p_sys
->
psz_aenc
);
transcode_audio_close
(
p_stream
,
id
);
return
VLC_EGENERIC
;
}
id
->
p_encoder
->
fmt_in
.
audio
.
i_format
=
id
->
p_encoder
->
fmt_in
.
i_codec
;
id
->
p_encoder
->
fmt_in
.
audio
.
i_bitspersample
=
audio_BitsPerSample
(
id
->
p_encoder
->
fmt_in
.
i_codec
);
#else
msg_Err
(
p_stream
,
"no audio filter found for mixing from"
" %i to %i channels"
,
fmt_last
.
audio
.
i_channels
,
id
->
p_encoder
->
fmt_in
.
audio
.
i_channels
);
transcode_audio_close
(
p_stream
,
id
);
return
VLC_EGENERIC
;
#endif
...
...
@@ -1449,12 +1472,12 @@ static void transcode_audio_close( sout_stream_t *p_stream,
/* Close decoder */
if
(
id
->
p_decoder
->
p_module
)
module_Unneed
(
id
->
p_decoder
,
id
->
p_decoder
->
p_module
);
id
->
p_decoder
->
p_module
=
0
;
id
->
p_decoder
->
p_module
=
NULL
;
/* Close encoder */
if
(
id
->
p_encoder
->
p_module
)
module_Unneed
(
id
->
p_encoder
,
id
->
p_encoder
->
p_module
);
id
->
p_encoder
->
p_module
=
0
;
id
->
p_encoder
->
p_module
=
NULL
;
/* Close filters */
for
(
i
=
0
;
i
<
id
->
i_filter
;
i
++
)
...
...
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