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
82358562
Commit
82358562
authored
Aug 23, 2008
by
David Flynn
Committed by
Derk-Jan Hartman
Aug 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[demux/ogg] Revise oggDirac support
Updated to use revised granule_position in oggDirac mapping.
parent
908d4049
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
32 deletions
+16
-32
modules/demux/ogg.c
modules/demux/ogg.c
+16
-32
No files found.
modules/demux/ogg.c
View file @
82358562
...
...
@@ -190,7 +190,6 @@ static void Ogg_ReadKateHeader( logical_stream_t *, ogg_packet * );
static
void
Ogg_ReadFlacHeader
(
demux_t
*
,
logical_stream_t
*
,
ogg_packet
*
);
static
void
Ogg_ReadAnnodexHeader
(
vlc_object_t
*
,
logical_stream_t
*
,
ogg_packet
*
);
static
void
Ogg_ReadDiracHeader
(
logical_stream_t
*
,
ogg_packet
*
);
static
uint32_t
Ogg_ReadDiracPictureNumber
(
ogg_packet
*
p_oggpacket
);
/*****************************************************************************
* Open: initializes ogg demux structures
...
...
@@ -469,7 +468,6 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
if
(
p_oggpacket
->
granulepos
>=
0
)
{
if
(
p_stream
->
fmt
.
i_codec
==
VLC_FOURCC
(
't'
,
'h'
,
'e'
,
'o'
)
||
p_stream
->
fmt
.
i_codec
==
VLC_FOURCC
(
'd'
,
'r'
,
'a'
,
'c'
)
||
p_stream
->
fmt
.
i_codec
==
VLC_FOURCC
(
'k'
,
'a'
,
't'
,
'e'
)
)
{
ogg_int64_t
iframe
=
p_oggpacket
->
granulepos
>>
...
...
@@ -480,6 +478,12 @@ static void Ogg_UpdatePCR( logical_stream_t *p_stream,
p_stream
->
i_pcr
=
(
iframe
+
pframe
)
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
}
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_FOURCC
(
'd'
,
'r'
,
'a'
,
'c'
)
)
{
ogg_int64_t
i_dts
=
p_oggpacket
->
granulepos
>>
31
;
/* NB, OggDirac granulepos values are in units of 2*picturerate */
p_stream
->
i_pcr
=
(
i_dts
/
2
)
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
;
}
else
{
p_stream
->
i_pcr
=
p_oggpacket
->
granulepos
*
INT64_C
(
1000000
)
...
...
@@ -706,15 +710,16 @@ static void Ogg_DecodePacket( demux_t *p_demux,
p_block
->
i_dts
=
p_block
->
i_pts
=
i_pts
;
else
if
(
p_stream
->
fmt
.
i_codec
==
VLC_FOURCC
(
'd'
,
'r'
,
'a'
,
'c'
)
)
{
/* every packet[1] in the stream contains a picture, there may
* be header cruft infront of it though
* [1] EXCEPT the BOS page/packet */
uint32_t
u_pnum
=
Ogg_ReadDiracPictureNumber
(
p_oggpacket
);
if
(
u_pnum
!=
0xffffffff
)
{
p_block
->
i_dts
=
p_block
->
i_pts
=
(
u_pnum
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
);
}
ogg_int64_t
dts
=
p_oggpacket
->
granulepos
>>
31
;
ogg_int64_t
delay
=
(
p_oggpacket
->
granulepos
>>
9
)
&
0x1fff
;
uint64_t
u_pnum
=
dts
+
delay
;
p_block
->
i_dts
=
p_stream
->
i_pcr
;
p_block
->
i_pts
=
0
;
/* NB, OggDirac granulepos values are in units of 2*picturerate */
if
(
-
1
!=
p_oggpacket
->
granulepos
)
p_block
->
i_pts
=
u_pnum
*
INT64_C
(
1000000
)
/
p_stream
->
f_rate
/
2
;
}
else
{
...
...
@@ -1650,27 +1655,6 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this,
}
}
/* every packet[1] in the stream contains a picture, there may
* be header cruft infront of it though
* [1] EXCEPT the BOS page/packet */
static
uint32_t
Ogg_ReadDiracPictureNumber
(
ogg_packet
*
p_oggpacket
)
{
uint32_t
u_pos
=
4
;
/* protect against falling off the edge */
while
(
u_pos
+
13
<
p_oggpacket
->
bytes
)
{
/* find the picture startcode */
if
(
p_oggpacket
->
packet
[
u_pos
]
&
0x08
)
{
return
GetDWBE
(
p_oggpacket
->
packet
+
u_pos
+
9
);
}
/* skip to the next dirac parse unit */
uint32_t
u_npo
=
GetDWBE
(
p_oggpacket
->
packet
+
u_pos
+
1
);
if
(
u_npo
==
0
)
u_npo
=
13
;
u_pos
+=
u_npo
;
}
return
-
1
;
}
static
uint32_t
dirac_uint
(
bs_t
*
p_bs
)
{
uint32_t
count
=
0
,
value
=
0
;
...
...
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