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
0d80d151
Commit
0d80d151
authored
Feb 24, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics.
parent
93eaf1bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
modules/access/vcd/cdrom.c
modules/access/vcd/cdrom.c
+16
-13
No files found.
modules/access/vcd/cdrom.c
View file @
0d80d151
...
@@ -94,7 +94,7 @@ vcddev_t *ioctl_Open( vlc_object_t *p_this, const char *psz_dev )
...
@@ -94,7 +94,7 @@ vcddev_t *ioctl_Open( vlc_object_t *p_this, const char *psz_dev )
/*
/*
* Initialize structure with default values
* Initialize structure with default values
*/
*/
p_vcddev
=
(
vcddev_t
*
)
malloc
(
sizeof
(
vcddev_t
)
);
p_vcddev
=
malloc
(
sizeof
(
*
p_vcddev
)
);
if
(
p_vcddev
==
NULL
)
if
(
p_vcddev
==
NULL
)
return
NULL
;
return
NULL
;
p_vcddev
->
i_vcdimage_handle
=
-
1
;
p_vcddev
->
i_vcdimage_handle
=
-
1
;
...
@@ -207,11 +207,11 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
...
@@ -207,11 +207,11 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
if
(
pp_sectors
)
if
(
pp_sectors
)
{
{
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
int
)
);
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
**
pp_sectors
)
);
if
(
*
pp_sectors
==
NULL
)
if
(
*
pp_sectors
==
NULL
)
return
0
;
return
0
;
memcpy
(
*
pp_sectors
,
p_vcddev
->
p_sectors
,
memcpy
(
*
pp_sectors
,
p_vcddev
->
p_sectors
,
(
i_tracks
+
1
)
*
sizeof
(
int
)
);
(
i_tracks
+
1
)
*
sizeof
(
**
pp_sectors
)
);
}
}
return
i_tracks
;
return
i_tracks
;
...
@@ -243,7 +243,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
...
@@ -243,7 +243,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
CDTOCDescriptor
*
pTrackDescriptors
;
CDTOCDescriptor
*
pTrackDescriptors
;
u_char
track
;
u_char
track
;
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
int
)
);
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
**
pp_sectors
)
);
if
(
*
pp_sectors
==
NULL
)
if
(
*
pp_sectors
==
NULL
)
{
{
darwin_freeTOC
(
pTOC
);
darwin_freeTOC
(
pTOC
);
...
@@ -348,7 +348,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
...
@@ -348,7 +348,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
((
unsigned
int
)
p_tocheader
[
1
]
<<
8
);
((
unsigned
int
)
p_tocheader
[
1
]
<<
8
);
p_fulltoc
=
malloc
(
i_toclength
);
p_fulltoc
=
malloc
(
i_toclength
);
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
int
)
);
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
**
pp_sectors
)
);
if
(
*
pp_sectors
==
NULL
||
p_fulltoc
==
NULL
)
if
(
*
pp_sectors
==
NULL
||
p_fulltoc
==
NULL
)
{
{
...
@@ -414,7 +414,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
...
@@ -414,7 +414,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
{
{
int
i
;
int
i
;
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
int
)
);
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
**
pp_sectors
)
);
if
(
*
pp_sectors
==
NULL
)
if
(
*
pp_sectors
==
NULL
)
return
0
;
return
0
;
...
@@ -447,7 +447,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
...
@@ -447,7 +447,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
{
{
int
i
;
int
i
;
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
int
)
);
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
**
pp_sectors
)
);
if
(
*
pp_sectors
==
NULL
)
if
(
*
pp_sectors
==
NULL
)
return
0
;
return
0
;
...
@@ -502,7 +502,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
...
@@ -502,7 +502,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
{
{
int
i
;
int
i
;
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
int
)
);
*
pp_sectors
=
malloc
(
(
i_tracks
+
1
)
*
sizeof
(
**
pp_sectors
)
);
if
(
*
pp_sectors
==
NULL
)
if
(
*
pp_sectors
==
NULL
)
return
0
;
return
0
;
...
@@ -539,8 +539,10 @@ int ioctl_ReadSectors( vlc_object_t *p_this, const vcddev_t *p_vcddev,
...
@@ -539,8 +539,10 @@ int ioctl_ReadSectors( vlc_object_t *p_this, const vcddev_t *p_vcddev,
uint8_t
*
p_block
;
uint8_t
*
p_block
;
int
i
;
int
i
;
if
(
i_type
==
VCD_TYPE
)
p_block
=
malloc
(
VCD_SECTOR_SIZE
*
i_nb
);
if
(
i_type
==
VCD_TYPE
)
else
p_block
=
p_buffer
;
p_block
=
malloc
(
VCD_SECTOR_SIZE
*
i_nb
);
else
p_block
=
p_buffer
;
if
(
p_vcddev
->
i_vcdimage_handle
!=
-
1
)
if
(
p_vcddev
->
i_vcdimage_handle
!=
-
1
)
{
{
...
@@ -933,7 +935,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
...
@@ -933,7 +935,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
p_sectors
=
buf
;
p_sectors
=
buf
;
p_sectors
[
i_tracks
]
=
MSF_TO_LBA
(
i_min
,
i_sec
,
i_frame
);
p_sectors
[
i_tracks
]
=
MSF_TO_LBA
(
i_min
,
i_sec
,
i_frame
);
msg_Dbg
(
p_this
,
"vcd track %i begins at sector:%i"
,
msg_Dbg
(
p_this
,
"vcd track %i begins at sector:%i"
,
i_tracks
,
p_sectors
[
i_tracks
]
);
(
int
)
i_tracks
,
(
int
)
p_sectors
[
i_tracks
]
);
i_tracks
++
;
i_tracks
++
;
break
;
break
;
}
}
...
@@ -947,7 +949,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
...
@@ -947,7 +949,7 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
p_sectors
[
i_tracks
]
=
lseek
(
p_vcddev
->
i_vcdimage_handle
,
0
,
SEEK_END
)
p_sectors
[
i_tracks
]
=
lseek
(
p_vcddev
->
i_vcdimage_handle
,
0
,
SEEK_END
)
/
VCD_SECTOR_SIZE
;
/
VCD_SECTOR_SIZE
;
msg_Dbg
(
p_this
,
"vcd track %i, begins at sector:%i"
,
msg_Dbg
(
p_this
,
"vcd track %i, begins at sector:%i"
,
i_tracks
,
p_sectors
[
i_tracks
]
);
(
int
)
i_tracks
,
(
int
)
p_sectors
[
i_tracks
]
);
p_vcddev
->
i_tracks
=
++
i_tracks
;
p_vcddev
->
i_tracks
=
++
i_tracks
;
p_vcddev
->
p_sectors
=
p_sectors
;
p_vcddev
->
p_sectors
=
p_sectors
;
i_ret
=
0
;
i_ret
=
0
;
...
@@ -966,6 +968,7 @@ error:
...
@@ -966,6 +968,7 @@ error:
****************************************************************************/
****************************************************************************/
static
void
CloseVCDImage
(
vlc_object_t
*
p_this
,
vcddev_t
*
p_vcddev
)
static
void
CloseVCDImage
(
vlc_object_t
*
p_this
,
vcddev_t
*
p_vcddev
)
{
{
VLC_UNUSED
(
p_this
);
if
(
p_vcddev
->
i_vcdimage_handle
!=
-
1
)
if
(
p_vcddev
->
i_vcdimage_handle
!=
-
1
)
close
(
p_vcddev
->
i_vcdimage_handle
);
close
(
p_vcddev
->
i_vcdimage_handle
);
else
else
...
@@ -1060,7 +1063,7 @@ static CDTOC *darwin_getTOC( vlc_object_t * p_this, const vcddev_t *p_vcddev )
...
@@ -1060,7 +1063,7 @@ static CDTOC *darwin_getTOC( vlc_object_t * p_this, const vcddev_t *p_vcddev )
buf_len
=
CFDataGetLength
(
data
)
+
1
;
buf_len
=
CFDataGetLength
(
data
)
+
1
;
range
=
CFRangeMake
(
0
,
buf_len
);
range
=
CFRangeMake
(
0
,
buf_len
);
if
(
(
pTOC
=
(
CDTOC
*
)
malloc
(
buf_len
)
)
!=
NULL
)
if
(
(
pTOC
=
malloc
(
buf_len
)
)
!=
NULL
)
{
{
CFDataGetBytes
(
data
,
range
,
(
u_char
*
)
pTOC
);
CFDataGetBytes
(
data
,
range
,
(
u_char
*
)
pTOC
);
}
}
...
...
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