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
6ce54993
Commit
6ce54993
authored
Sep 05, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XA: group ADPCM frames per ~50ms before sending to decoder
Sending one frame per block had way to high CPU overhead.
parent
3213591d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
modules/demux/xa.c
modules/demux/xa.c
+9
-6
No files found.
modules/demux/xa.c
View file @
6ce54993
...
...
@@ -62,6 +62,7 @@ struct demux_sys_t
int64_t
i_data_offset
;
unsigned
int
i_data_size
;
unsigned
int
i_block_frames
;
date_t
pts
;
};
...
...
@@ -79,7 +80,6 @@ typedef struct xa_header_t
uint16_t
wBitsPerSample
;
}
xa_header_t
;
/*****************************************************************************
* Open: check file and initializes structures
*****************************************************************************/
...
...
@@ -129,6 +129,8 @@ static int Open( vlc_object_t * p_this )
p_sys
->
i_data_offset
=
stream_Tell
(
p_demux
->
s
);
/* FIXME: better computation */
p_sys
->
i_data_size
=
p_xa
.
iSize
*
15
/
56
;
/* How many frames per block (1:1 is too CPU intensive) */
p_sys
->
i_block_frames
=
p_sys
->
fmt
.
audio
.
i_rate
/
(
28
*
20
)
+
1
;
msg_Dbg
(
p_demux
,
"fourcc: %4.4s, channels: %d, "
"freq: %d Hz, bitrate: %dKo/s, blockalign: %d"
,
...
...
@@ -154,6 +156,7 @@ static int Demux( demux_t *p_demux )
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
block_t
*
p_block
;
int64_t
i_offset
;
unsigned
i_frames
=
p_sys
->
i_block_frames
;
i_offset
=
stream_Tell
(
p_demux
->
s
);
...
...
@@ -164,20 +167,20 @@ static int Demux( demux_t *p_demux )
return
0
;
}
p_block
=
stream_Block
(
p_demux
->
s
,
p_sys
->
fmt
.
audio
.
i_bytes_per_frame
);
p_block
=
stream_Block
(
p_demux
->
s
,
p_sys
->
fmt
.
audio
.
i_bytes_per_frame
*
i_frames
);
if
(
p_block
==
NULL
)
{
msg_Warn
(
p_demux
,
"cannot read data"
);
return
0
;
}
i_frames
=
p_block
->
i_buffer
/
p_sys
->
fmt
.
audio
.
i_bytes_per_frame
;
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
,
i_frames
*
p_sys
->
fmt
.
audio
.
i_frame_length
);
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
p_block
->
i_pts
);
es_out_Send
(
p_demux
->
out
,
p_sys
->
p_es
,
p_block
);
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