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
edbfa973
Commit
edbfa973
authored
Dec 12, 2013
by
Tristan Matthews
Committed by
Tristan Matthews
Dec 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ogg: use CLOCK_FREQ
parent
bbe24b45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
modules/demux/ogg.c
modules/demux/ogg.c
+7
-7
modules/demux/oggseek.c
modules/demux/oggseek.c
+6
-6
No files found.
modules/demux/ogg.c
View file @
edbfa973
...
...
@@ -683,7 +683,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
}
assert
(
p_sys
->
i_length
>
0
);
i64
=
INT64_C
(
1000000
)
*
p_sys
->
i_length
*
f
;
i64
=
CLOCK_FREQ
*
p_sys
->
i_length
*
f
;
Ogg_ResetStreamHelper
(
p_sys
);
if
(
Oggseek_SeektoAbsolutetime
(
p_demux
,
p_stream
,
i64
)
>=
0
)
{
...
...
@@ -838,7 +838,7 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
sample
-=
p_stream
->
i_pre_skip
;
else
sample
=
0
;
p_stream
->
i_pcr
=
sample
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
p_stream
->
i_pcr
=
sample
*
CLOCK_FREQ
/
p_stream
->
f_rate
;
}
p_stream
->
i_pcr
+=
VLC_TS_0
;
...
...
@@ -853,7 +853,7 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
* If we can't then don't touch the old value. */
if
(
p_stream
->
fmt
.
i_cat
==
VIDEO_ES
)
/* 1 frame per packet */
p_stream
->
i_interpolated_pcr
+=
(
INT64_C
(
1000000
)
/
p_stream
->
f_rate
);
p_stream
->
i_interpolated_pcr
+=
(
CLOCK_FREQ
/
p_stream
->
f_rate
);
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_OPUS
&&
p_stream
->
i_previous_granulepos
>=
0
&&
(
duration
=
...
...
@@ -868,12 +868,12 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
else
sample
=
0
;
p_stream
->
i_interpolated_pcr
=
VLC_TS_0
+
sample
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
VLC_TS_0
+
sample
*
CLOCK_FREQ
/
p_stream
->
f_rate
;
}
else
if
(
p_stream
->
fmt
.
i_bitrate
)
{
p_stream
->
i_interpolated_pcr
+=
(
p_oggpacket
->
bytes
*
INT64_C
(
1000000
)
/
(
p_oggpacket
->
bytes
*
CLOCK_FREQ
/
p_stream
->
fmt
.
i_bitrate
/
8
);
}
}
...
...
@@ -1141,7 +1141,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
{
i_pts
=
VLC_TS_0
+
(
p_stream
->
i_previous_granulepos
-
p_block
->
i_nb_samples
-
p_stream
->
i_pre_skip
)
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
CLOCK_FREQ
/
p_stream
->
f_rate
;
}
p_stream
->
i_skip_frames
=
0
;
}
...
...
@@ -1196,7 +1196,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
/* granulepos for dirac is possibly broken, this value should be ignored */
if
(
-
1
!=
p_oggpacket
->
granulepos
)
p_block
->
i_pts
=
u_pnum
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
/
2
;
p_block
->
i_pts
=
u_pnum
*
CLOCK_FREQ
/
p_stream
->
f_rate
/
2
;
}
else
{
...
...
modules/demux/oggseek.c
View file @
edbfa973
...
...
@@ -775,7 +775,7 @@ int64_t Oggseek_GranuleToAbsTimestamp( logical_stream_t *p_stream,
if
(
p_stream
->
b_oggds
)
{
i_timestamp
=
i_granule
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
i_timestamp
=
i_granule
*
CLOCK_FREQ
/
p_stream
->
f_rate
;
}
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_THEORA
||
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_KATE
)
...
...
@@ -784,21 +784,21 @@ int64_t Oggseek_GranuleToAbsTimestamp( logical_stream_t *p_stream,
ogg_int64_t
pframe
=
i_granule
-
(
iframe
<<
p_stream
->
i_granule_shift
);
/* See Theora A.2.3 */
if
(
b_presentation
)
pframe
-=
p_stream
->
i_keyframe_offset
;
i_timestamp
=
(
iframe
+
pframe
)
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
i_timestamp
=
(
iframe
+
pframe
)
*
CLOCK_FREQ
/
p_stream
->
f_rate
;
}
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_DIRAC
)
{
ogg_int64_t
i_dts
=
i_granule
>>
31
;
/* NB, OggDirac granulepos values are in units of 2*picturerate */
i_timestamp
=
(
i_dts
/
2
)
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
i_timestamp
=
(
i_dts
/
2
)
*
CLOCK_FREQ
/
p_stream
->
f_rate
;
}
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_OPUS
)
{
i_timestamp
=
p_stream
->
i_pre_skip
+
i_granule
*
INT64_C
(
1000000
)
/
48000
;
i_timestamp
=
p_stream
->
i_pre_skip
+
i_granule
*
CLOCK_FREQ
/
48000
;
}
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_CODEC_VORBIS
)
{
i_timestamp
=
i_granule
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
i_timestamp
=
i_granule
*
CLOCK_FREQ
/
p_stream
->
f_rate
;
}
return
i_timestamp
;
...
...
@@ -821,7 +821,7 @@ bool Oggseek_PacketPCRFixup( logical_stream_t *p_stream, ogg_page *p_page,
p_stream
->
i_pcr
=
Oggseek_GranuleToAbsTimestamp
(
p_stream
,
ogg_page_granulepos
(
p_page
),
false
);
/* Computes the presentation time of the first packet on page */
p_stream
->
i_pcr
-=
INT64_C
(
1000000
)
*
p_stream
->
i_pcr
-=
CLOCK_FREQ
*
ogg_page_packets
(
p_page
)
/
p_stream
->
f_rate
;
return
true
;
}
...
...
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