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
90c26e78
Commit
90c26e78
authored
Mar 03, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: implementation of demux2_vaControlHelper.
parent
743502eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
1 deletion
+87
-1
src/input/demux.c
src/input/demux.c
+87
-1
No files found.
src/input/demux.c
View file @
90c26e78
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* demux.c
* demux.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* Copyright (C) 1999-2004 VideoLAN
* $Id: demux.c,v 1.1
1 2004/01/31 05:25:36
fenrir Exp $
* $Id: demux.c,v 1.1
2 2004/03/03 12:01:38
fenrir Exp $
*
*
* Author: Laurent Aimar <fenrir@via.ecp.fr>
* Author: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -266,3 +266,89 @@ void demux2_Delete( demux_t *p_demux )
...
@@ -266,3 +266,89 @@ void demux2_Delete( demux_t *p_demux )
vlc_object_destroy
(
p_demux
);
vlc_object_destroy
(
p_demux
);
}
}
/*****************************************************************************
* demux2_vaControlHelper:
*****************************************************************************/
int
demux2_vaControlHelper
(
stream_t
*
s
,
int64_t
i_start
,
int64_t
i_end
,
int
i_bitrate
,
int
i_align
,
int
i_query
,
va_list
args
)
{
int64_t
i_tell
;
double
f
,
*
pf
;
int64_t
i64
,
*
pi64
;
if
(
i_end
<
0
)
i_end
=
stream_Size
(
s
);
if
(
i_start
<
0
)
i_start
=
0
;
if
(
i_align
<=
0
)
i_align
=
1
;
i_tell
=
stream_Tell
(
s
);
switch
(
i_query
)
{
case
DEMUX_GET_LENGTH
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
i_bitrate
>
0
&&
i_end
>
i_start
)
{
*
pi64
=
I64C
(
8000000
)
*
(
i_end
-
i_start
)
/
i_bitrate
;
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
case
DEMUX_GET_TIME
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
i_bitrate
>
0
&&
i_end
>
i_start
)
{
*
pi64
=
I64C
(
8000000
)
*
(
i_tell
-
i_start
)
/
i_bitrate
;
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
case
DEMUX_GET_POSITION
:
pf
=
(
double
*
)
va_arg
(
args
,
double
*
);
if
(
i_start
<
i_end
)
{
*
pf
=
(
double
)(
i_tell
-
i_start
)
/
(
double
)(
i_end
-
i_start
);
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
case
DEMUX_SET_POSITION
:
f
=
(
double
)
va_arg
(
args
,
double
);
if
(
i_start
<
i_end
&&
f
>=
0
.
0
&&
f
<=
1
.
0
)
{
int64_t
i_block
=
(
f
*
(
i_end
-
i_start
))
/
i_align
;
if
(
stream_Seek
(
s
,
i_start
+
i_block
*
i_align
)
)
{
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
case
DEMUX_SET_TIME
:
i64
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
if
(
i_bitrate
>
0
&&
i64
>=
0
)
{
int64_t
i_block
=
i64
*
i_bitrate
/
I64C
(
8000000
)
/
i_align
;
if
(
stream_Seek
(
s
,
i_start
+
i_block
*
i_align
)
)
{
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
}
return
VLC_EGENERIC
;
case
DEMUX_GET_FPS
:
case
DEMUX_GET_META
:
return
VLC_EGENERIC
;
default:
msg_Err
(
s
,
"unknown query in demux_vaControlDefault"
);
return
VLC_EGENERIC
;
}
}
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