Branch Coverage

src/ogg.c
Criterion Covered Total %
branch 105 170 61.7


line true false branch
68 0 22 if ( !_check_buf(infile, &ogg_buf, 10, OGG_BLOCK_SIZE) ) {
75 0 22 if (
76 0 0 (bptr[0] == 'I' && bptr[1] == 'D' && bptr[2] == '3') &&
0 0 (bptr[0] == 'I' && bptr[1] == 'D' && bptr[2] == '3') &&
0 0 (bptr[0] == 'I' && bptr[1] == 'D' && bptr[2] == '3') &&
77 0 0 bptr[3] < 0xff && bptr[4] < 0xff &&
0 0 bptr[3] < 0xff && bptr[4] < 0xff &&
78 0 0 bptr[6] < 0x80 && bptr[7] < 0x80 && bptr[8] < 0x80 && bptr[9] < 0x80
0 0 bptr[6] < 0x80 && bptr[7] < 0x80 && bptr[8] < 0x80 && bptr[9] < 0x80
0 0 bptr[6] < 0x80 && bptr[7] < 0x80 && bptr[8] < 0x80 && bptr[9] < 0x80
83 0 0 if (bptr[5] & 0x10) {
99 0 165 if ( !_check_buf(infile, &ogg_buf, 28, OGG_BLOCK_SIZE) ) {
109 165 0 if ( ogghdr[0] != 'O' || ogghdr[1] != 'g' || ogghdr[2] != 'g' || ogghdr[3] != 'S' ) {
165 0 if ( ogghdr[0] != 'O' || ogghdr[1] != 'g' || ogghdr[2] != 'g' || ogghdr[3] != 'S' ) {
165 0 if ( ogghdr[0] != 'O' || ogghdr[1] != 'g' || ogghdr[2] != 'g' || ogghdr[3] != 'S' ) {
0 165 if ( ogghdr[0] != 'O' || ogghdr[1] != 'g' || ogghdr[2] != 'g' || ogghdr[3] != 'S' ) {
127 22 143 if ( header_type & 0x02 ) {
132 65 100 if ( !(header_type & 0x01) ) {
137 21 144 if (packets > 2 * streams && !buffer_len(&vorbis_buf) ) {
0 21 if (packets > 2 * streams && !buffer_len(&vorbis_buf) ) {
144 165 0 if (page >= 0 && page == pagenum) {
164 1 if (page >= 0 && page == pagenum) {
157 115 50 if (granule_pos > 0 && granule_pos != -1) {
22 93 if (granule_pos > 0 && granule_pos != -1) {
159 3 19 if (seeking) {
164 18 1 if ( buffer_len(&vorbis_buf) > 0 ) {
179 117 26 if (num_segments > 1) {
182 0 117 if ( !_check_buf(infile, &ogg_buf, num_segments, OGG_BLOCK_SIZE) ) {
187 1918 117 for( i = 0; i < num_segments - 1; i++ ) {
196 0 143 if ( !_check_buf(infile, &ogg_buf, pagelen, OGG_BLOCK_SIZE) ) {
202 0 143 if ( buffer_len(&ogg_buf) < pagelen ) {
216 43 100 if ( !vorbis_type ) {
219 0 43 if ( strncmp( buffer_ptr(&vorbis_buf), "vorbis", 6 ) ) {
228 22 121 if (vorbis_type == 1) {
231 0 22 if ( buffer_len(&vorbis_buf) < 23 ) {
281 17 5 if ( file_size > avg_buf_size ) {
290 0 22 if ( PerlIO_read(infile, buffer_append_space(&ogg_buf, avg_buf_size), avg_buf_size) == 0 ) {
291 0 0 if ( PerlIO_error(infile) ) {
305 41910 0 while (
307 41712 198 && (bptr[0] != 'O' || bptr[1] != 'g' || bptr[2] != 'g' || bptr[3] != 'S')
177 21 && (bptr[0] != 'O' || bptr[1] != 'g' || bptr[2] != 'g' || bptr[3] != 'S')
1 20 && (bptr[0] != 'O' || bptr[1] != 'g' || bptr[2] != 'g' || bptr[3] != 'S')
0 20 && (bptr[0] != 'O' || bptr[1] != 'g' || bptr[2] != 'g' || bptr[3] != 'S')
312 2 41888 if ( buf_size < 14 ) {
334 14 6 if ( granule_pos && samplerate && serialno == final_serialno ) {
14 0 if ( granule_pos && samplerate && serialno == final_serialno ) {
13 1 if ( granule_pos && samplerate && serialno == final_serialno ) {
354 0 22 if (err) return err;
378 269 31 while (num_comments--) {
382 1 268 if ( len > buffer_len(vorbis_buf) ) {
389 4 264 if (
412 0 4 if ( !picture ) {
418 2 2 if ( my_hv_exists(tags, "ALLPICTURES") ) {
420 2 0 if (entry != NULL) {
436 4 260 else if (
456 1 3 if ( _env_true("AUDIO_SCAN_NO_ARTWORK") ) {
471 0 4 if ( my_hv_exists(tags, "ALLPICTURES") ) {
473 0 0 if (entry != NULL) {
497 18 13 if (has_framing) {
514 0 3 if ( _ogg_parse(infile, file, info, tags, 1) != 0 ) {
518 3 0 song_length_ms = SvIV( *(my_hv_fetch( info, "song_length_ms" )) );
519 0 3 if (offset >= song_length_ms) {
523 3 0 samplerate = SvIV( *(my_hv_fetch( info, "samplerate" )) );
555 3 0 off_t audio_offset = SvIV( *(my_hv_fetch( info, "audio_offset" )) );
556 3 0 off_t file_size = SvIV( *(my_hv_fetch( info, "file_size" )) );
557 3 0 uint32_t serialno = SvIV( *(my_hv_fetch( info, "serial_number" )) );
566 28 0 while (low <= high) {
573 0 28 if (mid > file_size - 28) {
579 0 28 if ( (PerlIO_seek(infile, mid, SEEK_SET)) == -1 ) {
584 0 28 if ( !_check_buf(infile, &buf, 28, OGG_BLOCK_SIZE * 2) ) {
594 56 0 while (buf_size >= 4) {
599 205128 0 while (
601 204411 717 &&
602 661 56 (bptr[0] != 'O' || bptr[1] != 'g' || bptr[2] != 'g' || bptr[3] != 'S')
0 56 (bptr[0] != 'O' || bptr[1] != 'g' || bptr[2] != 'g' || bptr[3] != 'S')
0 56 (bptr[0] != 'O' || bptr[1] != 'g' || bptr[2] != 'g' || bptr[3] != 'S')
608 0 56 if (buf_size < 4) {
619 0 56 if ( !_check_buf(infile, &buf, 28, 28) ) {
637 0 56 if (serialno != cur_serialno) {
648 56 0 if (granule_pos && prev_granule_pos) {
28 28 if (granule_pos && prev_granule_pos) {
656 2 26 if ((prev_granule_pos + 1) <= target_sample && granule_pos >= target_sample) {
2 0 if ((prev_granule_pos + 1) <= target_sample && granule_pos >= target_sample) {
662 26 0 if (target_sample < (prev_granule_pos + 1)) {
664 1 25 if (prev_frame_offset == audio_offset) {