Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
696fa37a
Commit
696fa37a
authored
Nov 08, 2013
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AAC packetizer: move functions around file
parent
89646284
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
46 deletions
+44
-46
modules/packetizer/mpeg4audio.c
modules/packetizer/mpeg4audio.c
+44
-46
No files found.
modules/packetizer/mpeg4audio.c
View file @
696fa37a
...
...
@@ -258,6 +258,18 @@ static int OpenPacketizer(vlc_object_t *p_this)
return
VLC_SUCCESS
;
}
/*****************************************************************************
* ClosePacketizer: clean up the packetizer
*****************************************************************************/
static
void
ClosePacketizer
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
block_BytestreamRelease
(
&
p_sys
->
bytestream
);
free
(
p_sys
);
}
/****************************************************************************
* PacketizeRawBlock: the whole thing
****************************************************************************
...
...
@@ -863,10 +875,41 @@ static int LOASParse(decoder_t *p_dec, uint8_t *p_buffer, int i_buffer)
return
i_accumulated
;
}
/*****************************************************************************
*
*****************************************************************************/
static
void
SetupOutput
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
p_dec
->
fmt_out
.
audio
.
i_rate
!=
p_sys
->
i_rate
)
{
msg_Info
(
p_dec
,
"AAC channels: %d samplerate: %d"
,
p_sys
->
i_channels
,
p_sys
->
i_rate
);
const
mtime_t
i_end_date
=
date_Get
(
&
p_sys
->
end_date
);
date_Init
(
&
p_sys
->
end_date
,
p_sys
->
i_rate
,
1
);
date_Set
(
&
p_sys
->
end_date
,
i_end_date
);
}
p_dec
->
fmt_out
.
audio
.
i_rate
=
p_sys
->
i_rate
;
p_dec
->
fmt_out
.
audio
.
i_channels
=
p_sys
->
i_channels
;
p_dec
->
fmt_out
.
audio
.
i_bytes_per_frame
=
p_sys
->
i_frame_size
;
p_dec
->
fmt_out
.
audio
.
i_frame_length
=
p_sys
->
i_frame_length
;
#if 0
p_dec->fmt_out.audio.i_original_channels = p_sys->i_channels_conf;
p_dec->fmt_out.audio.i_physical_channels = p_sys->i_channels_conf;
#endif
p_block
->
i_pts
=
p_block
->
i_dts
=
date_Get
(
&
p_sys
->
end_date
);
p_block
->
i_length
=
date_Increment
(
&
p_sys
->
end_date
,
p_sys
->
i_frame_length
)
-
p_block
->
i_pts
;
}
/****************************************************************************
* PacketizeStreamBlock: ADTS/LOAS packetizer
****************************************************************************/
static
void
SetupOutput
(
decoder_t
*
p_dec
,
block_t
*
p_block
);
static
block_t
*
PacketizeStreamBlock
(
decoder_t
*
p_dec
,
block_t
**
pp_block
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
...
...
@@ -1046,48 +1089,3 @@ static block_t *PacketizeStreamBlock(decoder_t *p_dec, block_t **pp_block)
return
NULL
;
}
/*****************************************************************************
* SetupBuffer:
*****************************************************************************/
static
void
SetupOutput
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
if
(
p_dec
->
fmt_out
.
audio
.
i_rate
!=
p_sys
->
i_rate
)
{
msg_Info
(
p_dec
,
"AAC channels: %d samplerate: %d"
,
p_sys
->
i_channels
,
p_sys
->
i_rate
);
const
mtime_t
i_end_date
=
date_Get
(
&
p_sys
->
end_date
);
date_Init
(
&
p_sys
->
end_date
,
p_sys
->
i_rate
,
1
);
date_Set
(
&
p_sys
->
end_date
,
i_end_date
);
}
p_dec
->
fmt_out
.
audio
.
i_rate
=
p_sys
->
i_rate
;
p_dec
->
fmt_out
.
audio
.
i_channels
=
p_sys
->
i_channels
;
p_dec
->
fmt_out
.
audio
.
i_bytes_per_frame
=
p_sys
->
i_frame_size
;
p_dec
->
fmt_out
.
audio
.
i_frame_length
=
p_sys
->
i_frame_length
;
#if 0
p_dec->fmt_out.audio.i_original_channels = p_sys->i_channels_conf;
p_dec->fmt_out.audio.i_physical_channels = p_sys->i_channels_conf;
#endif
p_block
->
i_pts
=
p_block
->
i_dts
=
date_Get
(
&
p_sys
->
end_date
);
p_block
->
i_length
=
date_Increment
(
&
p_sys
->
end_date
,
p_sys
->
i_frame_length
)
-
p_block
->
i_pts
;
}
/*****************************************************************************
* ClosePacketizer: clean up the packetizer
*****************************************************************************/
static
void
ClosePacketizer
(
vlc_object_t
*
p_this
)
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
block_BytestreamRelease
(
&
p_sys
->
bytestream
);
free
(
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