| 1210 | } |
| 1211 | |
| 1212 | static 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 | |
| 1245 | static int isRecoveryPoint( const uint8_t *buf, int len ) |
| 1246 | { |