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
ed5b3247
Commit
ed5b3247
authored
Sep 17, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try computing an approximation of the length when we don't have mp3 bitrate
parent
92384683
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
modules/demux/mpeg/mpga.c
modules/demux/mpeg/mpga.c
+16
-0
No files found.
modules/demux/mpeg/mpga.c
View file @
ed5b3247
...
...
@@ -371,6 +371,22 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
i_ret
=
demux2_vaControlHelper
(
p_demux
->
s
,
0
,
-
1
,
p_sys
->
i_bitrate_avg
,
1
,
i_query
,
args
);
/* No bitrate, we can't have it precisely, but we can compute
* a raw approximation with time/position */
if
(
i_ret
&&
i_query
==
DEMUX_GET_LENGTH
&&!
p_sys
->
i_bitrate_avg
)
{
float
f_pos
=
(
double
)(
stream_Tell
(
p_demux
->
s
)
)
/
(
double
)(
stream_Size
(
p_demux
->
s
)
);
/* The first few seconds are guaranteed to be very whacky,
* don't bother trying ... Too bad */
if
(
f_pos
<
0
.
01
||
(
p_sys
->
i_pts
+
p_sys
->
i_time_offset
)
<
8000000
)
return
VLC_EGENERIC
;
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi64
=
(
p_sys
->
i_pts
+
p_sys
->
i_time_offset
)
/
f_pos
;
return
VLC_SUCCESS
;
}
if
(
!
i_ret
&&
p_sys
->
i_bitrate_avg
>
0
&&
(
i_query
==
DEMUX_SET_POSITION
||
i_query
==
DEMUX_SET_TIME
)
)
{
...
...
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