Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
2feaca93
Commit
2feaca93
authored
Dec 12, 2004
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpga.c: check/hack to make duration available after preparse
parent
c2d4afc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
25 deletions
+45
-25
modules/demux/mpeg/mpga.c
modules/demux/mpeg/mpga.c
+45
-25
No files found.
modules/demux/mpeg/mpga.c
View file @
2feaca93
...
@@ -72,6 +72,7 @@ struct demux_sys_t
...
@@ -72,6 +72,7 @@ struct demux_sys_t
int
i_xing_bytes
;
int
i_xing_bytes
;
int
i_xing_bitrate_avg
;
int
i_xing_bitrate_avg
;
int
i_xing_frame_samples
;
int
i_xing_frame_samples
;
block_t
*
p_block_in
,
*
p_block_out
;
};
};
static
int
HeaderCheck
(
uint32_t
h
)
static
int
HeaderCheck
(
uint32_t
h
)
...
@@ -114,12 +115,13 @@ static int Open( vlc_object_t * p_this )
...
@@ -114,12 +115,13 @@ static int Open( vlc_object_t * p_this )
{
{
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
;
demux_sys_t
*
p_sys
;
vlc_bool_t
b_forced
=
VLC_FALSE
;
vlc_bool_t
b_forced
=
VLC_FALSE
;
uint32_t
header
;
uint32_t
header
;
uint8_t
*
p_peek
;
uint8_t
*
p_peek
;
module_t
*
p_id3
;
module_t
*
p_id3
;
vlc_meta_t
*
p_meta
=
NULL
;
vlc_meta_t
*
p_meta
=
NULL
;
block_t
*
p_block_in
,
*
p_block_out
;
if
(
p_demux
->
psz_path
)
if
(
p_demux
->
psz_path
)
{
{
...
@@ -266,6 +268,30 @@ static int Open( vlc_object_t * p_this )
...
@@ -266,6 +268,30 @@ static int Open( vlc_object_t * p_this )
}
}
}
}
if
(
(
p_block_in
=
stream_Block
(
p_demux
->
s
,
MPGA_PACKET_SIZE
)
)
==
NULL
)
{
return
VLC_EGENERIC
;
}
p_block_in
->
i_pts
=
p_block_in
->
i_dts
=
1
;
p_block_out
=
p_sys
->
p_packetizer
->
pf_packetize
(
p_sys
->
p_packetizer
,
&
p_block_in
);
p_sys
->
p_packetizer
->
fmt_out
.
b_packetized
=
VLC_TRUE
;
p_sys
->
p_es
=
es_out_Add
(
p_demux
->
out
,
&
p_sys
->
p_packetizer
->
fmt_out
);
p_sys
->
i_bitrate_avg
=
p_sys
->
p_packetizer
->
fmt_out
.
i_bitrate
;
if
(
p_sys
->
i_xing_bytes
&&
p_sys
->
i_xing_frames
&&
p_sys
->
i_xing_frame_samples
)
{
p_sys
->
i_bitrate_avg
=
p_sys
->
i_xing_bytes
*
I64C
(
8
)
*
p_sys
->
p_packetizer
->
fmt_out
.
audio
.
i_rate
/
p_sys
->
i_xing_frames
/
p_sys
->
i_xing_frame_samples
;
}
p_sys
->
p_block_in
=
p_block_in
;
p_sys
->
p_block_out
=
p_block_out
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -278,39 +304,31 @@ static int Demux( demux_t *p_demux )
...
@@ -278,39 +304,31 @@ static int Demux( demux_t *p_demux )
{
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
block_t
*
p_block_in
,
*
p_block_out
;
block_t
*
p_block_in
,
*
p_block_out
;
if
(
p_sys
->
b_start
)
if
(
(
p_block_in
=
stream_Block
(
p_demux
->
s
,
MPGA_PACKET_SIZE
)
)
==
NULL
)
{
{
return
0
;
p_sys
->
b_start
=
VLC_FALSE
;
p_block_in
=
p_sys
->
p_block_in
;
p_block_out
=
p_sys
->
p_block_out
;
}
else
{
if
(
(
p_block_in
=
stream_Block
(
p_demux
->
s
,
MPGA_PACKET_SIZE
)
)
==
NULL
)
{
return
0
;
}
p_block_in
->
i_pts
=
p_block_in
->
i_dts
=
0
;
p_block_out
=
p_sys
->
p_packetizer
->
pf_packetize
(
p_sys
->
p_packetizer
,
&
p_block_in
);
}
}
p_block_in
->
i_pts
=
p_block_in
->
i_dts
=
p_sys
->
b_start
?
1
:
0
;
p_sys
->
b_start
=
VLC_FALSE
;
while
(
(
p_block_out
=
p_sys
->
p_packetizer
->
pf_packetize
(
while
(
p_block_out
)
p_sys
->
p_packetizer
,
&
p_block_in
))
)
{
{
while
(
p_block_out
)
while
(
p_block_out
)
{
{
block_t
*
p_next
=
p_block_out
->
p_next
;
block_t
*
p_next
=
p_block_out
->
p_next
;
if
(
p_sys
->
p_es
==
NULL
)
{
p_sys
->
p_packetizer
->
fmt_out
.
b_packetized
=
VLC_TRUE
;
p_sys
->
p_es
=
es_out_Add
(
p_demux
->
out
,
&
p_sys
->
p_packetizer
->
fmt_out
);
p_sys
->
i_bitrate_avg
=
p_sys
->
p_packetizer
->
fmt_out
.
i_bitrate
;
if
(
p_sys
->
i_xing_bytes
&&
p_sys
->
i_xing_frames
&&
p_sys
->
i_xing_frame_samples
)
{
p_sys
->
i_bitrate_avg
=
p_sys
->
i_xing_bytes
*
I64C
(
8
)
*
p_sys
->
p_packetizer
->
fmt_out
.
audio
.
i_rate
/
p_sys
->
i_xing_frames
/
p_sys
->
i_xing_frame_samples
;
}
}
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
p_block_out
->
i_dts
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
p_block_out
->
i_dts
);
p_block_out
->
p_next
=
NULL
;
p_block_out
->
p_next
=
NULL
;
...
@@ -319,6 +337,8 @@ static int Demux( demux_t *p_demux )
...
@@ -319,6 +337,8 @@ static int Demux( demux_t *p_demux )
p_block_out
=
p_next
;
p_block_out
=
p_next
;
}
}
p_block_out
=
p_sys
->
p_packetizer
->
pf_packetize
(
p_sys
->
p_packetizer
,
&
p_block_in
);
}
}
return
1
;
return
1
;
}
}
...
...
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