Skip to content
Snippets Groups Projects
Commit 284e3f6a authored by François Cartegnie's avatar François Cartegnie :fingers_crossed: Committed by Steve Lhomme
Browse files

demux: avi: add tag index keyframe for H26x

parent f2afde1e
No related branches found
No related tags found
1 merge request!2772demux: avi: add tag index keyframe for H26x
Pipeline #279616 passed with stage
in 14 minutes and 12 seconds
......@@ -46,6 +46,8 @@
#include "libavi.h"
#include "../rawdv.h"
#include "bitmapinfoheader.h"
#include "../packetizer/h264_nal.h"
#include "../packetizer/hevc_nal.h"
/*****************************************************************************
* Module descriptor
......@@ -2127,6 +2129,33 @@ static int AVI_GetKeyFlag( const avi_track_t *tk, const uint8_t *p_byte )
}
return p_byte[4] & 0xC0 ? 0 : AVIIF_KEYFRAME;
case VLC_CODEC_H264:
{
uint32_t bytes = GetDWBE( p_byte );
enum h264_nal_unit_type_e i_nal_type;
if( bytes == 0x00000001 )
i_nal_type = h264_getNALType( &p_byte[4] );
else if( (bytes & 0xFFFFFF00) == 0x00000100 )
i_nal_type = h264_getNALType( &p_byte[3] );
else
return i_nal_type = 0;
return (i_nal_type == H264_NAL_SLICE_IDR) ? AVIIF_KEYFRAME : 0;
}
case VLC_CODEC_HEVC:
{
uint32_t bytes = GetDWBE( p_byte );
uint8_t i_nal_type;
if( bytes == 0x00000001 )
i_nal_type = hevc_getNALType( &p_byte[4] );
else if( (bytes & 0xFFFFFF00) == 0x00000100 )
i_nal_type = hevc_getNALType( &p_byte[3] );
else
i_nal_type = 0;
return (i_nal_type >= HEVC_NAL_IDR_W_RADL &&
i_nal_type <= HEVC_NAL_CRA) ? AVIIF_KEYFRAME : 0;
}
default:
/* I can't do it, so say yes */
return AVIIF_KEYFRAME;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment