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
62eefa47
Commit
62eefa47
authored
Jan 18, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed decoder init when libdca is not present + clean up.
parent
ef3199b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
40 deletions
+49
-40
modules/codec/dts.c
modules/codec/dts.c
+49
-40
No files found.
modules/codec/dts.c
View file @
62eefa47
...
...
@@ -35,7 +35,23 @@
#include <vlc_aout.h>
#include <vlc_block_helper.h>
#define DTS_HEADER_SIZE 14
/*****************************************************************************
* Module descriptor
*****************************************************************************/
static
int
OpenDecoder
(
vlc_object_t
*
);
static
int
OpenPacketizer
(
vlc_object_t
*
);
static
void
CloseCommon
(
vlc_object_t
*
);
vlc_module_begin
()
set_description
(
N_
(
"DTS parser"
)
)
set_capability
(
"decoder"
,
100
)
set_callbacks
(
OpenDecoder
,
CloseCommon
)
add_submodule
()
set_description
(
N_
(
"DTS audio packetizer"
)
)
set_capability
(
"packetizer"
,
10
)
set_callbacks
(
OpenPacketizer
,
CloseCommon
)
vlc_module_end
()
/*****************************************************************************
* decoder_sys_t : decoder descriptor
...
...
@@ -77,16 +93,16 @@ enum {
STATE_SEND_DATA
};
#define DTS_HEADER_SIZE 14
/****************************************************************************
* Local prototypes
****************************************************************************/
static
int
OpenDecoder
(
vlc_object_t
*
);
static
int
OpenPacketizer
(
vlc_object_t
*
);
static
void
CloseDecoder
(
vlc_object_t
*
);
static
void
*
DecodeBlock
(
decoder_t
*
,
block_t
**
);
static
int
OpenCommon
(
vlc_object_t
*
,
bool
b_packetizer
);
static
void
*
DecodeBlock
(
decoder_t
*
,
block_t
**
);
static
inline
int
SyncCode
(
const
uint8_t
*
);
static
int
SyncInfo
(
const
uint8_t
*
,
unsigned
int
*
,
unsigned
int
*
,
static
int
SyncInfo
(
const
uint8_t
*
,
unsigned
int
*
,
unsigned
int
*
,
unsigned
int
*
,
unsigned
int
*
,
unsigned
int
*
);
static
uint8_t
*
GetOutBuffer
(
decoder_t
*
,
void
**
);
...
...
@@ -94,40 +110,45 @@ static aout_buffer_t *GetAoutBuffer( decoder_t * );
static
block_t
*
GetSoutBuffer
(
decoder_t
*
);
/*****************************************************************************
*
Module descripto
r
*
OpenDecoder: probe the decode
r
*****************************************************************************/
vlc_module_begin
()
set_description
(
N_
(
"DTS parser"
)
)
set_capability
(
"decoder"
,
100
)
set_callbacks
(
OpenDecoder
,
CloseDecoder
)
static
int
OpenDecoder
(
vlc_object_t
*
p_this
)
{
/* HACK: Don't use this codec if we don't have an dts audio filter */
if
(
!
module_exists
(
"dtstofloat32"
)
)
return
VLC_EGENERIC
;
add_submodule
()
set_description
(
N_
(
"DTS audio packetizer"
)
)
set_capability
(
"packetizer"
,
10
)
set_callbacks
(
OpenPacketizer
,
CloseDecoder
)
vlc_module_end
()
return
OpenCommon
(
p_this
,
false
);
}
/*****************************************************************************
* Open
Decoder: probe the decoder and return score
* Open
Packetizer: probe the packetizer
*****************************************************************************/
static
int
OpenDecoder
(
vlc_object_t
*
p_this
)
static
int
OpenPacketizer
(
vlc_object_t
*
p_this
)
{
return
OpenCommon
(
p_this
,
true
);
}
/*****************************************************************************
* OpenCommon:
*****************************************************************************/
static
int
OpenCommon
(
vlc_object_t
*
p_this
,
bool
b_packetizer
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
;
if
(
p_dec
->
fmt_in
.
i_codec
!=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
)
&&
p_dec
->
fmt_in
.
i_codec
!=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
'b'
)
)
if
(
p_dec
->
fmt_in
.
i_codec
!=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
)
&&
p_dec
->
fmt_in
.
i_codec
!=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
'b'
)
)
{
return
VLC_EGENERIC
;
}
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
(
decoder_sys_t
*
)
malloc
(
sizeof
(
decoder_sys_t
))
)
==
NULL
)
if
(
(
p_dec
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
))
)
==
NULL
)
return
VLC_ENOMEM
;
/* Misc init */
p_sys
->
b_packetizer
=
false
;
p_sys
->
b_packetizer
=
b_packetizer
;
p_sys
->
i_state
=
STATE_NOSYNC
;
aout_DateSet
(
&
p_sys
->
end_date
,
0
);
...
...
@@ -147,21 +168,8 @@ static int OpenDecoder( vlc_object_t *p_this )
return
VLC_SUCCESS
;
}
static
int
OpenPacketizer
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
int
i_ret
=
OpenDecoder
(
p_this
);
if
(
i_ret
==
VLC_SUCCESS
)
p_dec
->
p_sys
->
b_packetizer
=
true
;
return
i_ret
;
}
/****************************************************************************
* DecodeBlock: the whole thing
****************************************************************************
* This function is called just after the thread is launched.
****************************************************************************/
static
void
*
DecodeBlock
(
decoder_t
*
p_dec
,
block_t
**
pp_block
)
{
...
...
@@ -170,7 +178,8 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
uint8_t
*
p_buf
;
void
*
p_out_buffer
;
if
(
!
pp_block
||
!*
pp_block
)
return
NULL
;
if
(
!
pp_block
||
!*
pp_block
)
return
NULL
;
if
(
(
*
pp_block
)
->
i_flags
&
(
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
)
)
{
...
...
@@ -317,9 +326,9 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
}
/*****************************************************************************
* Close
Decoder
: clean up the decoder
* Close
Common
: clean up the decoder
*****************************************************************************/
static
void
Close
Decoder
(
vlc_object_t
*
p_this
)
static
void
Close
Common
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
...
...
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