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
7f2fcb75
Commit
7f2fcb75
authored
Aug 15, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check asprintf return value and avoid one unneeded strdup.
parent
f74112d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+13
-9
No files found.
modules/audio_output/auhal.c
View file @
7f2fcb75
...
...
@@ -965,7 +965,7 @@ static void Probe( aout_instance_t * p_aout )
p_sys
->
i_default_dev
=
devid_def
;
var_Create
(
p_aout
,
"audio-device"
,
VLC_VAR_INTEGER
|
VLC_VAR_HASCHOICE
);
text
.
psz_string
=
_
(
"Audio Device"
);
text
.
psz_string
=
(
char
*
)
_
(
"Audio Device"
);
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_SETTEXT
,
&
text
,
NULL
);
for
(
i
=
0
;
i
<
p_sys
->
i_devices
;
i
++
)
...
...
@@ -998,8 +998,9 @@ static void Probe( aout_instance_t * p_aout )
/* Add the menu entries */
val
.
i_int
=
(
int
)
p_devices
[
i
];
text
.
psz_string
=
strdup
(
psz_name
)
;
text
.
psz_string
=
psz_name
;
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
text
.
psz_string
=
NULL
;
if
(
p_sys
->
i_default_dev
==
p_devices
[
i
]
)
{
/* The default device is the selected device normally */
...
...
@@ -1010,14 +1011,17 @@ static void Probe( aout_instance_t * p_aout )
if
(
AudioDeviceSupportsDigital
(
p_aout
,
p_devices
[
i
]
)
)
{
val
.
i_int
=
(
int
)
p_devices
[
i
]
|
AOUT_VAR_SPDIF_FLAG
;
asprintf
(
&
text
.
psz_string
,
_
(
"%s (Encoded Output)"
),
psz_name
);
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
if
(
p_sys
->
i_default_dev
==
p_devices
[
i
]
&&
config_GetInt
(
p_aout
,
"spdif"
)
)
if
(
asprintf
(
&
text
.
psz_string
,
_
(
"%s (Encoded Output)"
),
psz_name
)
!=
-
1
)
{
/* We selected to prefer SPDIF output if available
* then this "dummy" entry should be selected */
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_SETDEFAULT
,
&
val
,
NULL
);
var_Set
(
p_aout
,
"audio-device"
,
val
);
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
free
(
text
.
psz_string
);
if
(
p_sys
->
i_default_dev
==
p_devices
[
i
]
&&
config_GetInt
(
p_aout
,
"spdif"
)
)
{
/* We selected to prefer SPDIF output if available
* then this "dummy" entry should be selected */
var_Change
(
p_aout
,
"audio-device"
,
VLC_VAR_SETDEFAULT
,
&
val
,
NULL
);
var_Set
(
p_aout
,
"audio-device"
,
val
);
}
}
}
...
...
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