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
da1ce99b
Commit
da1ce99b
authored
Sep 04, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdr: privatize seekpoint byte offsets
parent
3d83596e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
modules/access/vdr.c
modules/access/vdr.c
+21
-10
No files found.
modules/access/vdr.c
View file @
da1ce99b
...
...
@@ -122,6 +122,7 @@ struct access_sys_t
/* cut marks */
input_title_t
*
p_marks
;
uint64_t
*
offsets
;
unsigned
cur_seekpoint
;
float
fps
;
...
...
@@ -220,6 +221,8 @@ static void Close( vlc_object_t * p_this )
if
(
p_sys
->
p_meta
)
vlc_meta_Delete
(
p_sys
->
p_meta
);
size_t
count
=
p_sys
->
p_marks
->
i_seekpoint
;
TAB_CLEAN
(
count
,
p_sys
->
offsets
);
vlc_input_title_Delete
(
p_sys
->
p_marks
);
free
(
p_sys
);
}
...
...
@@ -318,7 +321,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
case
ACCESS_SET_SEEKPOINT
:
i
=
va_arg
(
args
,
int
);
return
Seek
(
p_access
,
p_sys
->
p_marks
->
seekpoint
[
i
]
->
i_byte_offset
);
return
Seek
(
p_access
,
p_sys
->
offsets
[
i
]
);
case
ACCESS_GET_META
:
if
(
!
p_sys
->
p_meta
)
...
...
@@ -425,8 +428,7 @@ static void FindSeekpoint( access_t *p_access )
return
;
int
new_seekpoint
=
p_sys
->
cur_seekpoint
;
if
(
p_sys
->
offset
<
(
uint64_t
)
p_sys
->
p_marks
->
seekpoint
[
p_sys
->
cur_seekpoint
]
->
i_byte_offset
)
if
(
p_sys
->
offset
<
p_sys
->
offsets
[
p_sys
->
cur_seekpoint
]
)
{
/* i_pos moved backwards, start fresh */
new_seekpoint
=
0
;
...
...
@@ -434,8 +436,7 @@ static void FindSeekpoint( access_t *p_access )
/* only need to check the following seekpoints */
while
(
new_seekpoint
+
1
<
p_sys
->
p_marks
->
i_seekpoint
&&
p_sys
->
offset
>=
(
uint64_t
)
p_sys
->
p_marks
->
seekpoint
[
new_seekpoint
+
1
]
->
i_byte_offset
)
p_sys
->
offset
>=
p_sys
->
offsets
[
new_seekpoint
+
1
]
)
{
new_seekpoint
++
;
}
...
...
@@ -819,6 +820,9 @@ static void ImportMarks( access_t *p_access )
p_marks
->
psz_name
=
strdup
(
_
(
"VDR Cut Marks"
)
);
p_marks
->
i_length
=
i_frame_count
*
(
int64_t
)(
CLOCK_FREQ
/
p_sys
->
fps
);
uint64_t
*
offsetv
=
NULL
;
size_t
offsetc
=
0
;
/* offset for chapter positions */
int
i_chapter_offset
=
p_sys
->
fps
/
1000
*
var_InheritInteger
(
p_access
,
"vdr-chapter-offset"
);
...
...
@@ -862,31 +866,38 @@ static void ImportMarks( access_t *p_access )
if
(
!
sp
)
continue
;
sp
->
i_time_offset
=
i_frame
*
(
int64_t
)(
CLOCK_FREQ
/
p_sys
->
fps
);
sp
->
i_byte_offset
=
i_offset
;
for
(
int
i
=
0
;
i
+
1
<
i_file_number
;
++
i
)
sp
->
i_byte_offset
+=
FILE_SIZE
(
i
);
sp
->
psz_name
=
strdup
(
line
);
TAB_APPEND
(
p_marks
->
i_seekpoint
,
p_marks
->
seekpoint
,
sp
);
TAB_APPEND
(
offsetc
,
offsetv
,
i_offset
);
for
(
int
i
=
0
;
i
+
1
<
i_file_number
;
++
i
)
offsetv
[
offsetc
-
1
]
+=
FILE_SIZE
(
i
);
}
/* add a chapter at the beginning if missing */
if
(
p_marks
->
i_seekpoint
>
0
&&
p_marks
->
seekpoint
[
0
]
->
i_byte_offset
>
0
)
if
(
p_marks
->
i_seekpoint
>
0
&&
offsetv
[
0
]
>
0
)
{
seekpoint_t
*
sp
=
vlc_seekpoint_New
();
if
(
sp
)
{
sp
->
i_byte_offset
=
0
;
sp
->
i_time_offset
=
0
;
sp
->
psz_name
=
strdup
(
_
(
"Start"
)
);
TAB_INSERT
(
p_marks
->
i_seekpoint
,
p_marks
->
seekpoint
,
sp
,
0
);
TAB_INSERT
(
offsetc
,
offsetv
,
UINT64_C
(
0
),
0
);
}
}
if
(
p_marks
->
i_seekpoint
>
0
)
{
p_sys
->
p_marks
=
p_marks
;
p_sys
->
offsets
=
offsetv
;
}
else
{
vlc_input_title_Delete
(
p_marks
);
TAB_CLEAN
(
offsetc
,
offsetv
);
}
fclose
(
marksfile
);
fclose
(
indexfile
);
...
...
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