Branch Coverage

src/flac.c
Criterion Covered Total %
branch 167 296 56.4


line true false branch
54 0 15 if ( !_check_buf(infile, flac->buf, 10, FLAC_BLOCK_SIZE) ) {
61 4 11 if (
62 4 0 (bptr[0] == 'I' && bptr[1] == 'D' && bptr[2] == '3') &&
4 0 (bptr[0] == 'I' && bptr[1] == 'D' && bptr[2] == '3') &&
4 0 (bptr[0] == 'I' && bptr[1] == 'D' && bptr[2] == '3') &&
63 4 0 bptr[3] < 0xff && bptr[4] < 0xff &&
4 0 bptr[3] < 0xff && bptr[4] < 0xff &&
64 4 0 bptr[6] < 0x80 && bptr[7] < 0x80 && bptr[8] < 0x80 && bptr[9] < 0x80
4 0 bptr[6] < 0x80 && bptr[7] < 0x80 && bptr[8] < 0x80 && bptr[9] < 0x80
4 0 bptr[6] < 0x80 && bptr[7] < 0x80 && bptr[8] < 0x80 && bptr[9] < 0x80
69 0 4 if (bptr[5] & 0x10) {
79 1 3 if ( id3_size < buffer_len(flac->buf) ) {
85 0 3 if (PerlIO_seek(infile, id3_size, SEEK_SET) < 0) {
91 0 4 if ( !_check_buf(infile, flac->buf, 4, FLAC_BLOCK_SIZE) ) {
99 0 15 if ( memcmp(bptr, "fLaC", 4) != 0 ) {
110 57 14 while ( !done ) {
114 0 57 if ( !_check_buf(infile, flac->buf, 4, FLAC_BLOCK_SIZE) ) {
121 14 43 if ( bptr[0] & 0x80 ) {
133 1 56 if ( len > flac->file_size - flac->audio_offset ) {
140 53 3 if ( type != FLAC_TYPE_PICTURE && type != FLAC_TYPE_PADDING ) {
40 13 if ( type != FLAC_TYPE_PICTURE && type != FLAC_TYPE_PADDING ) {
141 0 40 if ( !_check_buf(infile, flac->buf, len, len) ) {
155 7 6 if ( !flac->seeking ) {
166 1 1 if ( !flac->seeking ) {
176 3 5 if (flac->seeking) {
186 1 1 if ( !flac->seeking ) {
196 2 1 if ( !flac->seeking ) {
197 0 2 if ( !_flac_parse_picture(flac) ) {
214 14 0 song_length_ms = SvIV( *( my_hv_fetch(info, "song_length_ms") ) );
216 13 1 if (song_length_ms > 0) {
220 1 0 if (!seeking) {
231 1 0 if ( _flac_first_last_sample(flac, flac->audio_offset, &frame_offset, &first_sample, &tmp, 0) ) {
237 1 0 if ( _flac_first_last_sample(flac, flac->file_size - flac->max_framesize, &frame_offset, &tmp, &last_sample, 0) ) {
238 1 0 if (flac->samplerate) {
260 4 10 if (id3_size && !seeking) {
2 2 if (id3_size && !seeking) {
291 7 0 if ( !flac->samplerate || !flac->total_samples ) {
7 0 if ( !flac->samplerate || !flac->total_samples ) {
300 7 0 if (flac->min_blocksize == flac->max_blocksize && flac->min_blocksize > 0)
7 0 if (flac->min_blocksize == flac->max_blocksize && flac->min_blocksize > 0)
302 0 0 else if (flac->max_framesize > 0)
314 3 4 if (flac->num_seekpoints) {
325 14 0 for (i = flac->num_seekpoints - 1; i >= 0; i--) {
326 11 3 if (
328 11 0 && flac->seekpoints[i].frame_samples > 0
329 11 0 && (flac->total_samples <= 0 || flac->seekpoints[i].sample_number < flac->total_samples)
11 0 && (flac->total_samples <= 0 || flac->seekpoints[i].sample_number < flac->total_samples)
330 3 8 && flac->seekpoints[i].sample_number <= target_sample
335 3 0 if (i >= 0) {
345 25 1 for (i = 0; i < flac->num_seekpoints; i++) {
346 24 1 if (
348 24 0 && flac->seekpoints[i].frame_samples > 0
349 24 0 && (flac->total_samples <= 0 || flac->seekpoints[i].sample_number < flac->total_samples)
24 0 && (flac->total_samples <= 0 || flac->seekpoints[i].sample_number < flac->total_samples)
350 2 22 && flac->seekpoints[i].sample_number > target_sample
355 2 1 if (i < flac->num_seekpoints) {
364 3 0 if (new_upper_bound >= new_lower_bound) {
372 0 7 if (upper_bound_sample == lower_bound_sample)
375 106 1 while (max_tries--) {
381 106 0 if (lower_bound_sample >= upper_bound_sample || lower_bound > upper_bound) {
0 106 if (lower_bound_sample >= upper_bound_sample || lower_bound > upper_bound) {
396 106 0 if (pos < (int64_t)lower_bound)
399 0 106 if (pos >= (int64_t)upper_bound)
407 0 106 if (ret < 0) {
411 0 106 else if (ret == 0) {
422 0 106 if (this_frame_sample < lower_bound_sample) {
432 6 100 if (target_sample >= this_frame_sample && target_sample < last_sample) {
6 0 if (target_sample >= this_frame_sample && target_sample < last_sample) {
438 100 0 if (target_sample < this_frame_sample) {
467 7 0 if (flac->scratch->alloc)
490 0 108 if (seek_offset > flac->file_size - FLAC_FRAME_MAX_HEADER) {
496 0 108 if ( (PerlIO_seek(flac->infile, seek_offset, SEEK_SET)) == -1 ) {
502 0 108 if ( !_check_buf(flac->infile, flac->scratch, FLAC_FRAME_MAX_HEADER, flac->max_framesize) ) {
511 194496 0 for (i = 0; i != buf_size - FLAC_HEADER_LEN; i++) {
513 3201 191295 if ( bptr[i] != 0xFF
514 266 2935 || (bptr[i+1] >> 2) != 0x3E
515 166 100 || bptr[i+1] & 0x02
516 8 158 || bptr[i+3] & 0x01
525 2 156 if ( !_flac_read_frame_header(flac, &bptr[i], first_sample, last_sample) ) {
536 54 102 if (target_sample) {
537 54 0 if (target_sample >= *first_sample && target_sample < *last_sample) {
48 6 if (target_sample >= *first_sample && target_sample < *last_sample) {
541 0 48 else if (target_sample < *first_sample) {
553 0 108 if (ret <= 0)
603 156 2 if ( buf[1] & 0x01 || flac->min_blocksize != flac->max_blocksize ) {
0 156 if ( buf[1] & 0x01 || flac->min_blocksize != flac->max_blocksize ) {
606 0 2 if ( !_flac_read_utf8_uint64(buf, &xx, &raw_header_len) )
609 2 0 if ( xx == 0xFFFFFFFFFFFFFFFFLL )
618 0 156 if ( !_flac_read_utf8_uint32(buf, &x, &raw_header_len) )
621 0 156 if ( x == 0xFFFFFFFF )
629 1 155 if (blocksize_hint) {
632 1 0 if (blocksize_hint == 7) {
642 0 156 if (samplerate_hint) {
645 0 0 if (samplerate_hint != 12) {
652 0 156 if ( _flac_crc8(buf, raw_header_len) != crc8 ) {
658 152 4 if (frame_number) {
692 1 14 if ( !flac->max_framesize ) {
711 225 15 for (i = 1; i < 16; i++) {
730 0 1 if ( my_hv_exists(flac->tags, "APPLICATION") ) {
733 0 0 if (entry != NULL) {
757 0 3 New(0,
763 33 3 for (i = 0; i < count; i++) {
789 0 1 if (bptr[0]) {
804 15 1 while (num_tracks--) {
826 15 0 if (tracknum > 0 && tracknum < 100) {
14 1 if (tracknum > 0 && tracknum < 100) {
827 14 0 av_push( cue, newSVpvf(" TRACK %02u %s\n",
831 1 13 if (pre) {
835 1 13 if (isrc[0]) {
840 18 15 while (num_index--) {
851 18 0 if (is_cd) {
872 1 14 if (tracknum == 170) {
895 0 2 if ( !picture ) {
902 1 1 if ( _env_true("AUDIO_SCAN_NO_ARTWORK") ) {
912 0 2 if ( my_hv_exists(flac->tags, "ALLPICTURES") ) {
914 0 0 if (entry != NULL) {
972 782 156 while(len--)
987 0 2 if(!(x & 0x80)) { /* 0xxxxxxx */
991 2 0 else if(x & 0xC0 && !(x & 0x20)) { /* 110xxxxx */
2 0 else if(x & 0xC0 && !(x & 0x20)) { /* 110xxxxx */
995 0 0 else if(x & 0xE0 && !(x & 0x10)) { /* 1110xxxx */
0 0 else if(x & 0xE0 && !(x & 0x10)) { /* 1110xxxx */
999 0 0 else if(x & 0xF0 && !(x & 0x08)) { /* 11110xxx */
0 0 else if(x & 0xF0 && !(x & 0x08)) { /* 11110xxx */
1003 0 0 else if(x & 0xF8 && !(x & 0x04)) { /* 111110xx */
0 0 else if(x & 0xF8 && !(x & 0x04)) { /* 111110xx */
1007 0 0 else if(x & 0xFC && !(x & 0x02)) { /* 1111110x */
0 0 else if(x & 0xFC && !(x & 0x02)) { /* 1111110x */
1011 0 0 else if(x & 0xFE && !(x & 0x01)) { /* 11111110 */
0 0 else if(x & 0xFE && !(x & 0x01)) { /* 11111110 */
1020 2 0 for( ; i; i--) {
1022 0 2 if(!(x & 0x80) || (x & 0x40)) { /* 10xxxxxx */
0 0 if(!(x & 0x80) || (x & 0x40)) { /* 10xxxxxx */
1042 156 0 if(!(x & 0x80)) { /* 0xxxxxxx */
1046 0 0 else if(x & 0xC0 && !(x & 0x20)) { /* 110xxxxx */
0 0 else if(x & 0xC0 && !(x & 0x20)) { /* 110xxxxx */
1050 0 0 else if(x & 0xE0 && !(x & 0x10)) { /* 1110xxxx */
0 0 else if(x & 0xE0 && !(x & 0x10)) { /* 1110xxxx */
1054 0 0 else if(x & 0xF0 && !(x & 0x08)) { /* 11110xxx */
0 0 else if(x & 0xF0 && !(x & 0x08)) { /* 11110xxx */
1058 0 0 else if(x & 0xF8 && !(x & 0x04)) { /* 111110xx */
0 0 else if(x & 0xF8 && !(x & 0x04)) { /* 111110xx */
1062 0 0 else if(x & 0xFC && !(x & 0x02)) { /* 1111110x */
0 0 else if(x & 0xFC && !(x & 0x02)) { /* 1111110x */
1071 0 156 for( ; i; i--) {
1073 0 0 if(!(x & 0x80) || (x & 0x40)) { /* 10xxxxxx */
0 0 if(!(x & 0x80) || (x & 0x40)) { /* 10xxxxxx */
1087 2 13 if ( buffer_len(flac->buf) >= size ) {