Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
3e5a8ba4
Commit
3e5a8ba4
authored
Aug 26, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcd: switch to ACCESS_GET_(TITLE|SEEKPOINT)
parent
ae721f0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
38 deletions
+42
-38
modules/access/vcd/vcd.c
modules/access/vcd/vcd.c
+42
-38
No files found.
modules/access/vcd/vcd.c
View file @
3e5a8ba4
...
...
@@ -70,6 +70,8 @@ struct access_sys_t
/* Title infos */
int
i_titles
;
input_title_t
*
title
[
99
];
/* No more that 99 track in a vcd ? */
int
i_current_title
;
int
i_current_seekpoint
;
int
i_sector
;
/* Current Sector */
int
*
p_sectors
;
/* Track sectors */
...
...
@@ -196,8 +198,8 @@ static int Open( vlc_object_t *p_this )
p_access
->
info
.
b_eof
=
false
;
p_
access
->
info
.
i_title
=
i_title
;
p_
access
->
info
.
i
_seekpoint
=
i_chapter
;
p_
sys
->
i_current_title
=
i_title
;
p_
sys
->
i_current
_seekpoint
=
i_chapter
;
p_access
->
info
.
i_pos
=
(
uint64_t
)(
p_sys
->
i_sector
-
p_sys
->
p_sectors
[
1
+
i_title
]
)
*
VCD_DATA_SIZE
;
...
...
@@ -231,7 +233,6 @@ static int Control( access_t *p_access, int i_query, va_list args )
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
input_title_t
***
ppp_title
;
int
i
;
switch
(
i_query
)
{
...
...
@@ -245,7 +246,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case
ACCESS_GET_SIZE
:
*
va_arg
(
args
,
uint64_t
*
)
=
p_sys
->
title
[
p_
access
->
info
.
i
_title
]
->
i_size
;
p_sys
->
title
[
p_
sys
->
i_current
_title
]
->
i_size
;
break
;
/* */
...
...
@@ -264,42 +265,49 @@ static int Control( access_t *p_access, int i_query, va_list args )
/* Duplicate title infos */
*
ppp_title
=
malloc
(
sizeof
(
input_title_t
**
)
*
p_sys
->
i_titles
);
for
(
i
=
0
;
i
<
p_sys
->
i_titles
;
i
++
)
{
for
(
int
i
=
0
;
i
<
p_sys
->
i_titles
;
i
++
)
(
*
ppp_title
)[
i
]
=
vlc_input_title_Duplicate
(
p_sys
->
title
[
i
]
);
}
break
;
case
ACCESS_GET_TITLE
:
*
va_arg
(
args
,
unsigned
*
)
=
p_sys
->
i_current_title
;
break
;
case
ACCESS_GET_SEEKPOINT
:
*
va_arg
(
args
,
unsigned
*
)
=
p_sys
->
i_current_seekpoint
;
break
;
case
ACCESS_SET_TITLE
:
i
=
va_arg
(
args
,
int
);
if
(
i
!=
p_access
->
info
.
i_title
)
{
int
i
=
va_arg
(
args
,
int
);
if
(
i
!=
p_sys
->
i_current_title
)
{
/* Update info */
p_access
->
info
.
i_update
|=
INPUT_UPDATE_TITLE
|
INPUT_UPDATE_SEEKPOINT
;
p_access
->
info
.
i_title
=
i
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_sys
->
i_current_title
=
i
;
p_sys
->
i_current_seekpoint
=
0
;
p_access
->
info
.
i_pos
=
0
;
/* Next sector to read */
p_sys
->
i_sector
=
p_sys
->
p_sectors
[
1
+
i
];
}
break
;
}
case
ACCESS_SET_SEEKPOINT
:
{
input_title_t
*
t
=
p_sys
->
title
[
p_access
->
info
.
i_title
];
i
=
va_arg
(
args
,
int
);
int
i
=
va_arg
(
args
,
int
);
unsigned
i_title
=
p_sys
->
i_current_title
;
input_title_t
*
t
=
p_sys
->
title
[
i_title
];
if
(
t
->
i_seekpoint
>
0
)
{
p_access
->
info
.
i_update
|=
INPUT_UPDATE_SEEKPOINT
;
p_access
->
info
.
i_seekpoint
=
i
;
p_sys
->
i_current_seekpoint
=
i
;
p_sys
->
i_sector
=
p_sys
->
p_sectors
[
1
+
p_access
->
info
.
i_title
]
+
p_sys
->
i_sector
=
p_sys
->
p_sectors
[
1
+
i_title
]
+
t
->
seekpoint
[
i
]
->
i_byte_offset
/
VCD_DATA_SIZE
;
p_access
->
info
.
i_pos
=
(
uint64_t
)(
p_sys
->
i_sector
-
p_sys
->
p_sectors
[
1
+
p_access
->
info
.
i_title
])
*
VCD_DATA_SIZE
;
p_sys
->
p_sectors
[
1
+
i_title
])
*
VCD_DATA_SIZE
;
}
break
;
}
...
...
@@ -323,26 +331,24 @@ static block_t *Block( access_t *p_access )
if
(
p_access
->
info
.
b_eof
)
return
NULL
;
/* Check end of title */
while
(
p_sys
->
i_sector
>=
p_sys
->
p_sectors
[
p_
access
->
info
.
i
_title
+
2
]
)
while
(
p_sys
->
i_sector
>=
p_sys
->
p_sectors
[
p_
sys
->
i_current
_title
+
2
]
)
{
if
(
p_
access
->
info
.
i
_title
+
2
>=
p_sys
->
i_titles
)
if
(
p_
sys
->
i_current
_title
+
2
>=
p_sys
->
i_titles
)
{
p_access
->
info
.
b_eof
=
true
;
return
NULL
;
}
p_access
->
info
.
i_update
|=
INPUT_UPDATE_TITLE
|
INPUT_UPDATE_SEEKPOINT
;
p_access
->
info
.
i_title
++
;
p_access
->
info
.
i_seekpoint
=
0
;
p_sys
->
i_current_title
++
;
p_sys
->
i_current_seekpoint
=
0
;
p_access
->
info
.
i_pos
=
0
;
}
/* Don't read after the end of a title */
if
(
p_sys
->
i_sector
+
i_blocks
>=
p_sys
->
p_sectors
[
p_
access
->
info
.
i
_title
+
2
]
)
p_sys
->
p_sectors
[
p_
sys
->
i_current
_title
+
2
]
)
{
i_blocks
=
p_sys
->
p_sectors
[
p_
access
->
info
.
i
_title
+
2
]
-
p_sys
->
i_sector
;
i_blocks
=
p_sys
->
p_sectors
[
p_
sys
->
i_current
_title
+
2
]
-
p_sys
->
i_sector
;
}
/* Do the actual reading */
...
...
@@ -368,17 +374,16 @@ static block_t *Block( access_t *p_access )
/* Update seekpoints */
for
(
int
i_read
=
0
;
i_read
<
i_blocks
;
i_read
++
)
{
input_title_t
*
t
=
p_sys
->
title
[
p_
access
->
info
.
i
_title
];
input_title_t
*
t
=
p_sys
->
title
[
p_
sys
->
i_current
_title
];
if
(
t
->
i_seekpoint
>
0
&&
p_
access
->
info
.
i
_seekpoint
+
1
<
t
->
i_seekpoint
&&
p_
sys
->
i_current
_seekpoint
+
1
<
t
->
i_seekpoint
&&
(
int64_t
)
/* Unlikely to go over 8192 PetaB */
(
p_access
->
info
.
i_pos
+
i_read
*
VCD_DATA_SIZE
)
>=
t
->
seekpoint
[
p_
access
->
info
.
i_seekpoint
+
1
]
->
i_byte_offset
)
t
->
seekpoint
[
p_
sys
->
i_current_seekpoint
+
1
]
->
i_byte_offset
)
{
msg_Dbg
(
p_access
,
"seekpoint change"
);
p_access
->
info
.
i_update
|=
INPUT_UPDATE_SEEKPOINT
;
p_access
->
info
.
i_seekpoint
++
;
p_sys
->
i_current_seekpoint
++
;
}
}
...
...
@@ -395,13 +400,13 @@ static block_t *Block( access_t *p_access )
static
int
Seek
(
access_t
*
p_access
,
uint64_t
i_pos
)
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
input_title_t
*
t
=
p_sys
->
title
[
p_
access
->
info
.
i
_title
];
input_title_t
*
t
=
p_sys
->
title
[
p_
sys
->
i_current
_title
];
int
i_seekpoint
;
/* Next sector to read */
p_access
->
info
.
i_pos
=
i_pos
;
p_sys
->
i_sector
=
i_pos
/
VCD_DATA_SIZE
+
p_sys
->
p_sectors
[
p_
access
->
info
.
i
_title
+
1
];
p_sys
->
p_sectors
[
p_
sys
->
i_current
_title
+
1
];
/* Update current seekpoint */
for
(
i_seekpoint
=
0
;
i_seekpoint
<
t
->
i_seekpoint
;
i_seekpoint
++
)
...
...
@@ -411,11 +416,10 @@ static int Seek( access_t *p_access, uint64_t i_pos )
i_pos
<
(
uint64_t
)
t
->
seekpoint
[
i_seekpoint
+
1
]
->
i_byte_offset
)
break
;
}
if
(
i_seekpoint
!=
p_
access
->
info
.
i
_seekpoint
)
if
(
i_seekpoint
!=
p_
sys
->
i_current
_seekpoint
)
{
msg_Dbg
(
p_access
,
"seekpoint change"
);
p_access
->
info
.
i_update
|=
INPUT_UPDATE_SEEKPOINT
;
p_access
->
info
.
i_seekpoint
=
i_seekpoint
;
p_sys
->
i_current_seekpoint
=
i_seekpoint
;
}
/* Reset eof */
...
...
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