Commit 52ed5f49 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: h264: probe non sps nal

first nal from raw h264 dump might not be sps

refs issues/raw-h264/test.h264
parent 4a17358a
...@@ -84,9 +84,14 @@ static int Open( vlc_object_t * p_this ) ...@@ -84,9 +84,14 @@ static int Open( vlc_object_t * p_this )
if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC; if( stream_Peek( p_demux->s, &p_peek, 5 ) < 5 ) return VLC_EGENERIC;
if( p_peek[0] != 0x00 || p_peek[1] != 0x00 || const uint8_t i_nal_type = p_peek[4] & 0x1F;
p_peek[2] != 0x00 || p_peek[3] != 0x01 || const uint8_t i_ref_idc = p_peek[4] & 0x60;
(p_peek[4]&0x1F) != 7 ) /* SPS */ if( memcmp( p_peek, "\x00\x00\x00\x01", 4 ) ||
(p_peek[4] & 0x80) || /* reserved 0 */
i_nal_type == 0 || i_nal_type > 12 ||
( !i_ref_idc && (i_nal_type < 6 || i_nal_type == 7 || i_nal_type == 8) ) ||
( i_ref_idc && (i_nal_type == 6 || i_nal_type >= 9) )
)
{ {
if( !p_demux->b_force ) if( !p_demux->b_force )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment