Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
553ed228
Commit
553ed228
authored
Apr 28, 2009
by
Laurent Aimar
Browse files
Fixed syntax for VC1 coming from some ASF (packetizer).
The sequence header/entry point are not repeated yet.
parent
43d9cf9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/packetizer/vc1.c
View file @
553ed228
...
...
@@ -89,6 +89,7 @@ struct decoder_sys_t
mtime_t
i_interpolated_dts
;
bool
b_check_startcode
;
};
typedef
enum
...
...
@@ -151,6 +152,7 @@ static int Open( vlc_object_t *p_this )
p_sys
->
pp_last
=
&
p_sys
->
p_frame
;
p_sys
->
i_interpolated_dts
=
-
1
;
p_sys
->
b_check_startcode
=
p_dec
->
fmt_in
.
b_packetized
;
if
(
p_dec
->
fmt_out
.
i_extra
>
0
)
{
...
...
@@ -193,7 +195,37 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
return
packetizer_Packetize
(
&
p_sys
->
packetizer
,
pp_block
);
if
(
p_sys
->
b_check_startcode
&&
pp_block
&&
*
pp_block
)
{
/* Fix syntax for (some?) VC1 from asf */
const
int
i_startcode
=
sizeof
(
p_vc1_startcode
);
block_t
*
p_block
=
*
pp_block
;
if
(
p_block
->
i_buffer
>
0
&&
(
p_block
->
i_buffer
<
i_startcode
||
memcmp
(
p_block
->
p_buffer
,
p_vc1_startcode
,
i_startcode
)
)
)
{
*
pp_block
=
p_block
=
block_Realloc
(
p_block
,
i_startcode
+
1
,
p_block
->
i_buffer
);
if
(
p_block
)
{
memcpy
(
p_block
->
p_buffer
,
p_vc1_startcode
,
i_startcode
);
if
(
p_sys
->
b_sequence_header
&&
p_sys
->
sh
.
b_interlaced
&&
p_block
->
i_buffer
>
i_startcode
+
1
&&
(
p_block
->
p_buffer
[
i_startcode
+
1
]
&
0xc0
)
==
0xc0
)
p_block
->
p_buffer
[
i_startcode
]
=
IDU_TYPE_FIELD
;
else
p_block
->
p_buffer
[
i_startcode
]
=
IDU_TYPE_FRAME
;
}
}
p_sys
->
b_check_startcode
=
false
;
}
block_t
*
p_au
=
packetizer_Packetize
(
&
p_sys
->
packetizer
,
pp_block
);
if
(
!
p_au
)
p_sys
->
b_check_startcode
=
p_dec
->
fmt_in
.
b_packetized
;
return
p_au
;
}
static
void
PacketizeReset
(
void
*
p_private
,
bool
b_broken
)
...
...
Write
Preview
Supports
Markdown
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