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
Show 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,37 +495,7 @@ static int Demux( demux_t *p_demux )
...
@@ -495,37 +495,7 @@ 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'
)
||
{
int
i_sub
=
(
p_sys
->
buffer
[
1
]
>>
4
)
&
0x0f
;
uint8_t
*
p_sub
=
&
p_sys
->
buffer
[
2
+
2
*
i_sub
];
/* 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
(
'a'
,
't'
,
'r'
,
'c'
)
||
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
's'
,
'i'
,
'p'
,
'r'
)
||
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
's'
,
'i'
,
'p'
,
'r'
)
||
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'2'
,
'8'
,
'_'
,
'8'
)
)
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'2'
,
'8'
,
'_'
,
'8'
)
)
...
@@ -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,6 +582,32 @@ static int Demux( demux_t *p_demux )
...
@@ -614,6 +582,32 @@ 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
(
'm'
,
'p'
,
'4'
,
'a'
)
)
{
int
i_sub
=
(
p_sys
->
buffer
[
1
]
>>
4
)
&
0x0f
;
uint8_t
*
p_sub
=
&
p_sys
->
buffer
[
2
+
2
*
i_sub
];
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
{
block_t
*
p_block
=
block_New
(
p_demux
,
i_size
);
if
(
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
)
)
if
(
tk
->
fmt
.
i_codec
==
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
)
)
{
{
uint8_t
*
src
=
p_sys
->
buffer
;
uint8_t
*
src
=
p_sys
->
buffer
;
...
@@ -636,6 +630,7 @@ static int Demux( demux_t *p_demux )
...
@@ -636,6 +630,7 @@ static int Demux( demux_t *p_demux )
es_out_Send
(
p_demux
->
out
,
tk
->
p_es
,
p_block
);
es_out_Send
(
p_demux
->
out
,
tk
->
p_es
,
p_block
);
}
}
}
}
}
return
1
;
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