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
80a2e686
Commit
80a2e686
authored
Sep 10, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all : added mpeg 2.5 support.
parent
df56b0c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
modules/demux/mpeg/mpga.c
modules/demux/mpeg/mpga.c
+8
-8
modules/packetizer/mpegaudio.c
modules/packetizer/mpegaudio.c
+8
-2
No files found.
modules/demux/mpeg/mpga.c
View file @
80a2e686
...
...
@@ -2,7 +2,7 @@
* mpga.c : MPEG-I/II Audio input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mpga.c,v 1.
3 2003/09/07 22:48:29
fenrir Exp $
* $Id: mpga.c,v 1.
4 2003/09/10 21:56:44
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -44,7 +44,6 @@ vlc_module_begin();
vlc_module_end
();
/* TODO:
* - mpeg 2.5
* - free bitrate
*/
...
...
@@ -64,12 +63,12 @@ struct demux_sys_t
static
int
HeaderCheck
(
uint32_t
h
)
{
if
(
(((
h
>>
2
0
)
&
0x0FFF
)
!=
0x0FFF
)
/* header sync */
||
(((
h
>>
17
)
&
0x03
)
==
0
)
/* valid layer ?*/
if
(
(((
h
>>
2
1
)
&
0x07FF
)
!=
0x07FF
)
/* header sync */
||
(((
h
>>
17
)
&
0x03
)
==
0
)
/* valid layer ?*/
||
(((
h
>>
12
)
&
0x0F
)
==
0x0F
)
||
(((
h
>>
12
)
&
0x0F
)
==
0x00
)
/* valid bitrate ? */
||
(((
h
>>
10
)
&
0x03
)
==
0x03
)
/* valide sampling freq ? */
||
((
h
&
0x03
)
==
0x02
))
/* valid emphasis ? */
||
(((
h
>>
12
)
&
0x0F
)
==
0x00
)
/* valid bitrate ? */
||
(((
h
>>
10
)
&
0x03
)
==
0x03
)
/* valide sampling freq ? */
||
((
h
&
0x03
)
==
0x02
))
/* valid emphasis ? */
{
return
(
VLC_FALSE
);
}
...
...
@@ -99,7 +98,8 @@ static int mpga_bitrate[2][3][16] =
#define MPGA_VERSION( h ) ( 1 - (((h)>>19)&0x01) )
#define MPGA_LAYER( h ) ( 3 - (((h)>>17)&0x03) )
#define MPGA_SAMPLE_RATE(h) mpga_sample_rate[MPGA_VERSION(h)][((h)>>10)&0x03]
#define MPGA_SAMPLE_RATE(h) \
( mpga_sample_rate[MPGA_VERSION(h)][((h)>>10)&0x03] / ( ((h>>20)&0x01) ? 1 : 2) )
#define MPGA_CHANNELS(h) ( (((h)>>6)&0x03) == 3 ? 1 : 2)
#define MPGA_BITRATE(h) mpga_bitrate[MPGA_VERSION(h)][MPGA_LAYER(h)][((h)>>12)&0x0f]
#define MPGA_PADDING(h) ( ((h)>>9)&0x01 )
...
...
modules/packetizer/mpegaudio.c
View file @
80a2e686
...
...
@@ -2,7 +2,7 @@
* mpegaudio.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mpegaudio.c,v 1.
8 2003/09/02 20:19:26 gbazin
Exp $
* $Id: mpegaudio.c,v 1.
9 2003/09/10 21:56:44 fenrir
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
...
...
@@ -228,7 +228,7 @@ static void PacketizeThread( packetizer_t *p_pack )
RealignBits
(
&
p_pack
->
bit_stream
);
while
(
ShowBits
(
&
p_pack
->
bit_stream
,
1
2
)
!=
0x0f
ff
&&
while
(
ShowBits
(
&
p_pack
->
bit_stream
,
1
1
)
!=
0x07
ff
&&
!
p_pack
->
p_fifo
->
b_die
&&
!
p_pack
->
p_fifo
->
b_error
)
{
//msg_Warn( p_pack->p_fifo, "trash..." );
...
...
@@ -268,6 +268,12 @@ static void PacketizeThread( packetizer_t *p_pack )
i_channels
=
(
i_mode
==
3
)
?
1
:
2
;
i_bitrate
=
mpegaudio_bitrate
[
i_version
][
i_layer
][
i_bitrate_index
];
i_samplerate
=
mpegaudio_samplerate
[
i_version
][
i_samplerate_index
];
if
(
(
i_sync
&
0x01
)
==
0x00
)
{
/* mpeg 2.5 */
i_samplerate
/=
2
;
}
switch
(
i_layer
)
{
case
0
:
...
...
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