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
b6dd43d5
Commit
b6dd43d5
authored
Dec 17, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: ogg: add preparsing of headers (fix #6691)
parent
4572f451
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
10 deletions
+29
-10
modules/demux/ogg.c
modules/demux/ogg.c
+26
-10
modules/demux/ogg.h
modules/demux/ogg.h
+3
-0
No files found.
modules/demux/ogg.c
View file @
b6dd43d5
...
...
@@ -194,6 +194,7 @@ static int Open( vlc_object_t * p_this )
return
VLC_ENOMEM
;
p_sys
->
i_length
=
-
1
;
p_sys
->
b_preparsing_done
=
false
;
/* Set exported functions */
p_demux
->
pf_demux
=
Demux
;
...
...
@@ -205,6 +206,10 @@ static int Open( vlc_object_t * p_this )
/* */
TAB_INIT
(
p_sys
->
i_seekpoints
,
p_sys
->
pp_seekpoints
);
while
(
!
p_sys
->
b_preparsing_done
&&
p_demux
->
pf_demux
(
p_demux
)
>
0
)
{}
return
VLC_SUCCESS
;
}
...
...
@@ -265,6 +270,9 @@ static int Demux( demux_t * p_demux )
if
(
Ogg_BeginningOfStream
(
p_demux
)
!=
VLC_SUCCESS
)
return
0
;
if
(
!
p_sys
->
skeleton
.
major
)
p_sys
->
b_preparsing_done
=
true
;
/* Find the real duration */
stream_Control
(
p_demux
->
s
,
STREAM_CAN_SEEK
,
&
b_canseek
);
if
(
b_canseek
)
...
...
@@ -300,23 +308,28 @@ static int Demux( demux_t * p_demux )
{
/* If we delayed restarting encoders/SET_ES_FMT for more
* skeleton provided configuration */
if
(
p_sys
->
p_skelstream
&&
p_sys
->
p_skelstream
->
i_serial_no
==
ogg_page_serialno
(
&
p_sys
->
current_page
)
)
if
(
p_sys
->
p_skelstream
)
{
msg_Dbg
(
p_demux
,
"End of Skeleton"
);
for
(
i_stream
=
0
;
i_stream
<
p_sys
->
i_streams
;
i_stream
++
)
if
(
p_sys
->
p_skelstream
->
i_serial_no
==
ogg_page_serialno
(
&
p_sys
->
current_page
)
)
{
logical_stream_t
*
p_stream
=
p_sys
->
pp_stream
[
i_stream
];
if
(
p_stream
->
b_have_updated_format
)
msg_Dbg
(
p_demux
,
"End of Skeleton"
);
p_sys
->
b_preparsing_done
=
true
;
for
(
i_stream
=
0
;
i_stream
<
p_sys
->
i_streams
;
i_stream
++
)
{
p_stream
->
b_have_updated_format
=
false
;
if
(
p_stream
->
p_skel
)
Ogg_ApplySkeleton
(
p_stream
);
msg_Dbg
(
p_demux
,
"Resetting format for stream %d"
,
i_stream
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_ES_FMT
,
p_stream
->
p_es
,
&
p_stream
->
fmt
);
logical_stream_t
*
p_stream
=
p_sys
->
pp_stream
[
i_stream
];
if
(
p_stream
->
b_have_updated_format
)
{
p_stream
->
b_have_updated_format
=
false
;
if
(
p_stream
->
p_skel
)
Ogg_ApplySkeleton
(
p_stream
);
msg_Dbg
(
p_demux
,
"Resetting format for stream %d"
,
i_stream
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_ES_FMT
,
p_stream
->
p_es
,
&
p_stream
->
fmt
);
}
}
}
}
for
(
i_stream
=
0
;
i_stream
<
p_sys
->
i_streams
;
i_stream
++
)
{
if
(
p_sys
->
pp_stream
[
i_stream
]
->
i_serial_no
==
ogg_page_serialno
(
&
p_sys
->
current_page
)
)
...
...
@@ -510,6 +523,8 @@ static int Demux( demux_t * p_demux )
/* if a page was waiting, it's now processed */
p_sys
->
b_page_waiting
=
false
;
p_sys
->
b_preparsing_done
=
true
;
p_sys
->
i_pcr
=
-
1
;
for
(
i_stream
=
0
;
i_stream
<
p_sys
->
i_streams
;
i_stream
++
)
{
...
...
@@ -1264,6 +1279,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
memcpy
(
p_block
->
p_buffer
,
p_oggpacket
->
packet
+
i_header_len
,
p_oggpacket
->
bytes
-
i_header_len
);
assert
(
p_ogg
->
b_preparsing_done
);
es_out_Send
(
p_demux
->
out
,
p_stream
->
p_es
,
p_block
);
}
...
...
modules/demux/ogg.h
View file @
b6dd43d5
...
...
@@ -167,6 +167,9 @@ struct demux_sys_t
int
i_attachments
;
input_attachment_t
**
attachments
;
/* preparsing info */
bool
b_preparsing_done
;
/* Length, if available. */
int64_t
i_length
;
...
...
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