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
6e7434a1
Commit
6e7434a1
authored
Apr 15, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- demux with much bigger buffers to avoid performance issue
- fix silences handling
parent
93339c0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
+28
-20
modules/demux/voc.c
modules/demux/voc.c
+28
-20
No files found.
modules/demux/voc.c
View file @
6e7434a1
...
@@ -57,14 +57,13 @@ struct demux_sys_t
...
@@ -57,14 +57,13 @@ struct demux_sys_t
es_format_t
fmt
;
es_format_t
fmt
;
es_out_id_t
*
p_es
;
es_out_id_t
*
p_es
;
int64_t
i_block_offset
;
int64_t
i_block_start
;
int64_t
i_block_end
;
int64_t
i_loop_offset
;
int64_t
i_loop_offset
;
unsigned
i_loop_count
;
unsigned
i_loop_count
;
unsigned
i_silence_countdown
;
unsigned
i_silence_countdown
;
int32_t
i_block_size
;
date_t
pts
;
date_t
pts
;
};
};
...
@@ -114,7 +113,7 @@ static int Open( vlc_object_t * p_this )
...
@@ -114,7 +113,7 @@ static int Open( vlc_object_t * p_this )
if
(
p_sys
==
NULL
)
if
(
p_sys
==
NULL
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
p_sys
->
i_silence_countdown
=
p_sys
->
i_block_
offset
=
p_sys
->
i_block_size
=
p_sys
->
i_silence_countdown
=
p_sys
->
i_block_
start
=
p_sys
->
i_block_end
=
p_sys
->
i_loop_count
=
0
;
p_sys
->
i_loop_count
=
0
;
p_sys
->
p_es
=
NULL
;
p_sys
->
p_es
=
NULL
;
...
@@ -308,8 +307,8 @@ static int ReadBlockHeader( demux_t *p_demux )
...
@@ -308,8 +307,8 @@ static int ReadBlockHeader( demux_t *p_demux )
break
;
break
;
}
}
p_sys
->
i_block_s
ize
=
i_block_size
;
p_sys
->
i_block_s
tart
=
stream_Tell
(
p_demux
->
s
)
;
p_sys
->
i_block_
offset
=
stream_Tell
(
p_demux
->
s
)
;
p_sys
->
i_block_
end
=
p_sys
->
i_block_start
+
i_block_size
;
if
(
i_block_size
||
p_sys
->
i_silence_countdown
)
if
(
i_block_size
||
p_sys
->
i_silence_countdown
)
{
{
...
@@ -352,19 +351,24 @@ static int Demux( demux_t *p_demux )
...
@@ -352,19 +351,24 @@ 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
;
block_t
*
p_block
;
int64_t
i_offset
;
int64_t
i_offset
,
i
;
i_offset
=
stream_Tell
(
p_demux
->
s
);
while
(
(
i_offset
>=
p_sys
->
i_block_end
)
&&
(
p_sys
->
i_silence_countdown
==
0
)
)
if
(
ReadBlockHeader
(
p_demux
)
!=
VLC_SUCCESS
)
return
0
;
if
(
p_sys
->
i_silence_countdown
==
0
)
if
(
p_sys
->
i_silence_countdown
==
0
)
{
{
i_offset
=
stream_Tell
(
p_demux
->
s
);
i
=
(
p_sys
->
i_block_end
-
i_offset
)
/
p_sys
->
fmt
.
audio
.
i_bytes_per_frame
;
while
(
(
i_offset
>=
p_sys
->
i_block_offset
+
p_sys
->
i_block_size
)
if
(
i
>
100
)
&&
(
p_sys
->
i_silence_countdown
==
0
)
)
i
=
100
;
if
(
ReadBlockHeader
(
p_demux
)
!=
VLC_SUCCESS
)
return
0
;
p_block
=
stream_Block
(
p_demux
->
s
,
p_block
=
stream_Block
(
p_demux
->
s
,
p_sys
->
fmt
.
audio
.
i_bytes_per_frame
);
p_sys
->
fmt
.
audio
.
i_bytes_per_frame
*
i
);
if
(
p_block
==
NULL
)
if
(
p_block
==
NULL
)
{
{
msg_Warn
(
p_demux
,
"cannot read data"
);
msg_Warn
(
p_demux
,
"cannot read data"
);
...
@@ -373,16 +377,20 @@ static int Demux( demux_t *p_demux )
...
@@ -373,16 +377,20 @@ static int Demux( demux_t *p_demux )
}
}
else
else
{
/* emulates silence from the stream */
{
/* emulates silence from the stream */
p_block
=
block_New
(
p_demux
,
1
);
i
=
p_sys
->
i_silence_countdown
;
if
(
i
>
100
)
i
=
100
;
p_block
=
block_New
(
p_demux
,
i
);
if
(
p_block
==
NULL
)
if
(
p_block
==
NULL
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
p_block
->
p_buffer
[
0
]
=
0
;
memset
(
p_block
->
p_buffer
,
0
,
i
)
;
p_sys
->
i_silence_countdown
--
;
p_sys
->
i_silence_countdown
-=
i
;
}
}
p_block
->
i_dts
=
p_block
->
i_pts
=
p_block
->
i_dts
=
p_block
->
i_pts
=
date_Increment
(
&
p_sys
->
pts
,
p_sys
->
fmt
.
audio
.
i_frame_length
);
date_Increment
(
&
p_sys
->
pts
,
p_sys
->
fmt
.
audio
.
i_frame_length
*
i
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
p_block
->
i_pts
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
p_block
->
i_pts
);
...
@@ -408,8 +416,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -408,8 +416,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
return
demux2_vaControlHelper
(
p_demux
->
s
,
p_sys
->
i_block_
offse
t
,
return
demux2_vaControlHelper
(
p_demux
->
s
,
p_sys
->
i_block_
star
t
,
p_sys
->
i_block_
offset
+
p_sys
->
i_block_size
,
p_sys
->
i_block_
end
,
p_sys
->
fmt
.
i_bitrate
,
p_sys
->
fmt
.
i_bitrate
,
p_sys
->
fmt
.
audio
.
i_blockalign
,
p_sys
->
fmt
.
audio
.
i_blockalign
,
i_query
,
args
);
i_query
,
args
);
...
...
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