MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / CreateDecodedNAL

Function CreateDecodedNAL

libhb/stream.c:1212–1243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1210}
1211
1212static void CreateDecodedNAL( uint8_t **dst, int *dst_len,
1213 const uint8_t *src, int src_len )
1214{
1215 const uint8_t *end = &src[src_len];
1216 uint8_t *d = malloc( src_len );
1217
1218 *dst = d;
1219
1220 if( d )
1221 {
1222 while( src < end )
1223 {
1224 if( src < end - 3 && src[0] == 0x00 && src[1] == 0x00 &&
1225 src[2] == 0x01 )
1226 {
1227 // Next start code found
1228 break;
1229 }
1230 if( src < end - 3 && src[0] == 0x00 && src[1] == 0x00 &&
1231 src[2] == 0x03 )
1232 {
1233 *d++ = 0x00;
1234 *d++ = 0x00;
1235
1236 src += 3;
1237 continue;
1238 }
1239 *d++ = *src++;
1240 }
1241 }
1242 *dst_len = d - *dst;
1243}
1244
1245static int isRecoveryPoint( const uint8_t *buf, int len )
1246{

Callers 1

isRecoveryPointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected