Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
31e8f235
Commit
31e8f235
authored
Dec 29, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DirectSound: cosmetics and error path fix
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
3ff8a01e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
modules/audio_output/directx.c
modules/audio_output/directx.c
+19
-13
No files found.
modules/audio_output/directx.c
View file @
31e8f235
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
* GNU General Public License for more details.
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* along with this program; if not, write to the Free Software
Foundation, Inc.,
*
Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
*****************************************************************************/
/*****************************************************************************
/*****************************************************************************
...
@@ -580,7 +580,6 @@ static void Play( aout_instance_t *p_aout )
...
@@ -580,7 +580,6 @@ static void Play( aout_instance_t *p_aout )
if
(
!
p_aout
->
output
.
p_sys
->
b_playing
)
if
(
!
p_aout
->
output
.
p_sys
->
b_playing
)
{
{
aout_buffer_t
*
p_buffer
;
aout_buffer_t
*
p_buffer
;
int
i
;
p_aout
->
output
.
p_sys
->
b_playing
=
1
;
p_aout
->
output
.
p_sys
->
b_playing
=
1
;
...
@@ -589,7 +588,7 @@ static void Play( aout_instance_t *p_aout )
...
@@ -589,7 +588,7 @@ static void Play( aout_instance_t *p_aout )
aout_FifoFirstDate
(
p_aout
,
&
p_aout
->
output
.
fifo
);
aout_FifoFirstDate
(
p_aout
,
&
p_aout
->
output
.
fifo
);
/* fill in the first samples */
/* fill in the first samples */
for
(
i
=
0
;
i
<
FRAMES_NUM
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
FRAMES_NUM
;
i
++
)
{
{
p_buffer
=
aout_FifoPop
(
p_aout
,
&
p_aout
->
output
.
fifo
);
p_buffer
=
aout_FifoPop
(
p_aout
,
&
p_aout
->
output
.
fifo
);
if
(
!
p_buffer
)
break
;
if
(
!
p_buffer
)
break
;
...
@@ -649,7 +648,8 @@ static int CALLBACK CallBackDirectSoundEnum( LPGUID p_guid, LPCWSTR psz_desc,
...
@@ -649,7 +648,8 @@ static int CALLBACK CallBackDirectSoundEnum( LPGUID p_guid, LPCWSTR psz_desc,
char
*
psz_device
=
FromWide
(
psz_desc
);
char
*
psz_device
=
FromWide
(
psz_desc
);
msg_Dbg
(
p_aout
,
"found device: %s"
,
psz_device
);
msg_Dbg
(
p_aout
,
"found device: %s"
,
psz_device
);
if
(
p_aout
->
output
.
p_sys
->
psz_device
&&
!
strcmp
(
p_aout
->
output
.
p_sys
->
psz_device
,
psz_device
)
&&
p_guid
)
if
(
p_aout
->
output
.
p_sys
->
psz_device
&&
!
strcmp
(
p_aout
->
output
.
p_sys
->
psz_device
,
psz_device
)
&&
p_guid
)
{
{
/* Use the device corresponding to psz_device */
/* Use the device corresponding to psz_device */
p_aout
->
output
.
p_sys
->
p_device_guid
=
malloc
(
sizeof
(
GUID
)
);
p_aout
->
output
.
p_sys
->
p_device_guid
=
malloc
(
sizeof
(
GUID
)
);
...
@@ -669,7 +669,7 @@ static int CALLBACK CallBackDirectSoundEnum( LPGUID p_guid, LPCWSTR psz_desc,
...
@@ -669,7 +669,7 @@ static int CALLBACK CallBackDirectSoundEnum( LPGUID p_guid, LPCWSTR psz_desc,
}
}
free
(
psz_device
);
free
(
psz_device
);
return
1
;
return
true
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -1132,7 +1132,7 @@ static int CALLBACK CallBackConfigNBEnum( LPGUID p_guid, LPCWSTR psz_desc,
...
@@ -1132,7 +1132,7 @@ static int CALLBACK CallBackConfigNBEnum( LPGUID p_guid, LPCWSTR psz_desc,
int
*
a
=
(
int
*
)
p_nb
;
int
*
a
=
(
int
*
)
p_nb
;
(
*
a
)
++
;
(
*
a
)
++
;
return
1
;
return
true
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -1147,8 +1147,8 @@ static int CALLBACK CallBackConfigEnum( LPGUID p_guid, LPCWSTR psz_desc,
...
@@ -1147,8 +1147,8 @@ static int CALLBACK CallBackConfigEnum( LPGUID p_guid, LPCWSTR psz_desc,
p_item
->
ppsz_list
[
p_item
->
i_list
]
=
FromWide
(
psz_desc
);
p_item
->
ppsz_list
[
p_item
->
i_list
]
=
FromWide
(
psz_desc
);
p_item
->
ppsz_list_text
[
p_item
->
i_list
]
=
FromWide
(
psz_desc
);
p_item
->
ppsz_list_text
[
p_item
->
i_list
]
=
FromWide
(
psz_desc
);
p_item
->
i_list
=
p_item
->
i_list
+
1
;
p_item
->
i_list
++
;
return
1
;
return
true
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -1178,28 +1178,34 @@ static int ReloadDirectXDevices( vlc_object_t *p_this, char const *psz_name,
...
@@ -1178,28 +1178,34 @@ static int ReloadDirectXDevices( vlc_object_t *p_this, char const *psz_name,
if
(
hdsound_dll
==
NULL
)
if
(
hdsound_dll
==
NULL
)
{
{
msg_Warn
(
p_this
,
"cannot open DSOUND.DLL"
);
msg_Warn
(
p_this
,
"cannot open DSOUND.DLL"
);
return
VLC_SUCCESS
;
}
}
/* Get DirectSoundEnumerate */
/* Get DirectSoundEnumerate */
OurDirectSoundEnumerate
=
(
void
*
)
OurDirectSoundEnumerate
=
(
void
*
)
GetProcAddress
(
hdsound_dll
,
"DirectSoundEnumerateW"
);
GetProcAddress
(
hdsound_dll
,
"DirectSoundEnumerateW"
);
if
(
OurDirectSoundEnumerate
==
NULL
)
goto
error
;
int
nb_devices
=
0
;
int
nb_devices
=
0
;
OurDirectSoundEnumerate
(
CallBackConfigNBEnum
,
&
nb_devices
);
OurDirectSoundEnumerate
(
CallBackConfigNBEnum
,
&
nb_devices
);
msg_Dbg
(
p_this
,
"found %d devices"
,
nb_devices
);
msg_Dbg
(
p_this
,
"found %d devices"
,
nb_devices
);
p_item
->
ppsz_list
=
xrealloc
(
p_item
->
ppsz_list
,
p_item
->
ppsz_list
=
xrealloc
(
p_item
->
ppsz_list
,
nb_devices
*
sizeof
(
char
*
)
);
nb_devices
*
sizeof
(
char
*
)
);
p_item
->
ppsz_list_text
=
xrealloc
(
p_item
->
ppsz_list_text
,
p_item
->
ppsz_list_text
=
xrealloc
(
p_item
->
ppsz_list_text
,
nb_devices
*
sizeof
(
char
*
)
);
nb_devices
*
sizeof
(
char
*
)
);
p_item
->
i_list
=
0
;
p_item
->
i_list
=
0
;
OurDirectSoundEnumerate
(
CallBackConfigEnum
,
p_item
);
OurDirectSoundEnumerate
(
CallBackConfigEnum
,
p_item
);
FreeLibrary
(
hdsound_dll
);
/* Signal change to the interface */
/* Signal change to the interface */
p_item
->
b_dirty
=
true
;
p_item
->
b_dirty
=
true
;
error:
FreeLibrary
(
hdsound_dll
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
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