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
accc4e29
Commit
accc4e29
authored
Dec 11, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Real Demuxer: Code factorisation after previous commit.
parent
8d153467
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
48 deletions
+43
-48
modules/demux/real.c
modules/demux/real.c
+43
-48
No files found.
modules/demux/real.c
View file @
accc4e29
...
@@ -495,40 +495,10 @@ static int Demux( demux_t *p_demux )
...
@@ -495,40 +495,10 @@ static int Demux( demux_t *p_demux )
}
}
else
if
(
tk
->
fmt
.
i_cat
==
AUDIO_ES
&&
b_selected
)
else
if
(
tk
->
fmt
.
i_cat
==
AUDIO_ES
&&
b_selected
)
{
{
if
(
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
)
)
if
(
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'c'
,
'o'
,
'o'
,
'k'
)
||
{
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'a'
,
't'
,
'r'
,
'c'
)
||
int
i_sub
=
(
p_sys
->
buffer
[
1
]
>>
4
)
&
0x0f
;
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
's'
,
'i'
,
'p'
,
'r'
)
||
uint8_t
*
p_sub
=
&
p_sys
->
buffer
[
2
+
2
*
i_sub
];
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'2'
,
'8'
,
'_'
,
'8'
)
)
/* Set PCR */
if
(
p_sys
->
i_pcr
<
i_pts
)
{
p_sys
->
i_pcr
=
i_pts
;
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
(
int64_t
)
p_sys
->
i_pcr
);
}
int
i
;
for
(
i
=
0
;
i
<
i_sub
;
i
++
)
{
int
i_sub_size
=
GetWBE
(
&
p_sys
->
buffer
[
2
+
i
*
2
]);
block_t
*
p_block
=
block_New
(
p_demux
,
i_sub_size
);
if
(
p_block
)
{
memcpy
(
p_block
->
p_buffer
,
p_sub
,
i_sub_size
);
p_sub
+=
i_sub_size
;
p_block
->
i_dts
=
p_block
->
i_pts
=
(
i
==
0
?
i_pts
:
0
);
es_out_Send
(
p_demux
->
out
,
tk
->
p_es
,
p_block
);
}
}
}
else
if
(
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'c'
,
'o'
,
'o'
,
'k'
)
||
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'a'
,
't'
,
'r'
,
'c'
)
||
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
's'
,
'i'
,
'p'
,
'r'
)
||
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'2'
,
'8'
,
'_'
,
'8'
)
)
{
{
uint8_t
*
p_buf
=
p_sys
->
buffer
;
uint8_t
*
p_buf
=
p_sys
->
buffer
;
int
y
=
tk
->
i_subpacket
/
(
tk
->
i_frame_size
/
tk
->
i_subpacket_size
);
int
y
=
tk
->
i_subpacket
/
(
tk
->
i_frame_size
/
tk
->
i_subpacket_size
);
...
@@ -604,9 +574,7 @@ static int Demux( demux_t *p_demux )
...
@@ -604,9 +574,7 @@ static int Demux( demux_t *p_demux )
}
}
else
else
{
{
block_t
*
p_block
=
block_New
(
p_demux
,
i_size
);
/* Set PCR */
/* Set the PCR */
if
(
p_sys
->
i_pcr
<
i_pts
)
if
(
p_sys
->
i_pcr
<
i_pts
)
{
{
p_sys
->
i_pcr
=
i_pts
;
p_sys
->
i_pcr
=
i_pts
;
...
@@ -614,26 +582,53 @@ static int Demux( demux_t *p_demux )
...
@@ -614,26 +582,53 @@ static int Demux( demux_t *p_demux )
(
int64_t
)
p_sys
->
i_pcr
);
(
int64_t
)
p_sys
->
i_pcr
);
}
}
if
(
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'
a'
,
'5'
,
'2'
,
'
'
)
)
if
(
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'
m'
,
'p'
,
'4'
,
'a
'
)
)
{
{
uint8_t
*
src
=
p_sys
->
buffer
;
int
i_sub
=
(
p_sys
->
buffer
[
1
]
>>
4
)
&
0x0f
;
uint8_t
*
dst
=
p_block
->
p_buffer
;
uint8_t
*
p_sub
=
&
p_sys
->
buffer
[
2
+
2
*
i_sub
]
;
/* byte swap data */
int
i
;
while
(
dst
<
&
p_block
->
p_buffer
[
i_size
-
1
]
)
for
(
i
=
0
;
i
<
i_sub
;
i
++
)
{
{
*
dst
++
=
src
[
1
];
int
i_sub_size
=
GetWBE
(
&
p_sys
->
buffer
[
2
+
i
*
2
]);
*
dst
++
=
src
[
0
];
block_t
*
p_block
=
block_New
(
p_demux
,
i_sub_size
);
if
(
p_block
)
{
memcpy
(
p_block
->
p_buffer
,
p_sub
,
i_sub_size
);
p_sub
+=
i_sub_size
;
src
+=
2
;
p_block
->
i_dts
=
p_block
->
i_pts
=
(
i
==
0
?
i_pts
:
0
);
es_out_Send
(
p_demux
->
out
,
tk
->
p_es
,
p_block
);
}
}
}
}
}
else
else
{
{
memcpy
(
p_block
->
p_buffer
,
p_sys
->
buffer
,
i_size
);
block_t
*
p_block
=
block_New
(
p_demux
,
i_size
);
if
(
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
)
)
{
uint8_t
*
src
=
p_sys
->
buffer
;
uint8_t
*
dst
=
p_block
->
p_buffer
;
/* byte swap data */
while
(
dst
<
&
p_block
->
p_buffer
[
i_size
-
1
])
{
*
dst
++
=
src
[
1
];
*
dst
++
=
src
[
0
];
src
+=
2
;
}
}
else
{
memcpy
(
p_block
->
p_buffer
,
p_sys
->
buffer
,
i_size
);
}
p_block
->
i_dts
=
p_block
->
i_pts
=
i_pts
;
es_out_Send
(
p_demux
->
out
,
tk
->
p_es
,
p_block
);
}
}
p_block
->
i_dts
=
p_block
->
i_pts
=
i_pts
;
es_out_Send
(
p_demux
->
out
,
tk
->
p_es
,
p_block
);
}
}
}
}
...
...
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