Branch Coverage

src/mp4.c
Criterion Covered Total %
branch 613 1008 60.8


line true false branch
38 1 0 if ( my_hv_exists(info, "seek_offset") ) {
83 1 4 if (mp4->track_count > 1) {
88 0 4 if ( !my_hv_exists(info, "samplerate") ) {
103 4 0 !mp4->num_time_to_samples
104 4 0 || !mp4->num_sample_byte_sizes
105 4 0 || !mp4->num_sample_to_chunks
106 0 4 || !mp4->num_chunk_offsets
114 4 0 while ( (i < mp4->num_time_to_samples) &&
4 0 while ( (i < mp4->num_time_to_samples) &&
126 4 0 if (j <= mp4->time_to_sample[i].sample_count) {
140 0 4 if ( new_sample >= mp4->num_sample_byte_sizes ) {
157 0 4 Newz(0, stts, stts_entries * sizeof(*stts), struct tts);
159 6341 4 for (i = new_sample; i < total_sample_count; i++) {
162 6337 4 if (cur_duration && cur_duration == duration) {
6336 1 if (cur_duration && cur_duration == duration) {
178 5 4 for (i = 0; i < stts_entries; i++) {
202 1 3 for (i = 1; i < mp4->num_sample_to_chunks; i++) {
209 1 0 if (new_sample < total_samples + range_samples)
219 1 3 if (new_sample >= mp4->sample_to_chunk[0].samples_per_chunk) {
235 0 4 if (chunk > mp4->num_chunk_offsets) {
244 0 4 if (chunk_sample > new_sample) {
251 5 4 for (i = chunk_sample; i < new_sample; i++) {
257 0 4 if (file_offset > mp4->audio_offset + mp4->audio_size) {
273 0 4 Newz(0, stsc, stsc_entries * sizeof(*stsc), struct stc);
275 1271 4 for (i = chunk; i <= mp4->num_chunk_offsets; i++) {
279 1267 4 if (cur_samples_per_chunk && cur_samples_per_chunk == samples_in_chunk) {
1265 2 if (cur_samples_per_chunk && cur_samples_per_chunk == samples_in_chunk) {
288 4 2 if (j == 1) {
306 6 4 for (i = 0; i < stsc_entries; i++) {
331 6341 4 for (i = new_sample; i < mp4->num_sample_byte_sizes; i++) {
366 1271 4 for (i = chunk - 1; i < mp4->num_chunk_offsets; i++) {
367 4 1267 if (i == chunk - 1) {
411 4 0 if (mp4->time_to_sample) Safefree(mp4->time_to_sample);
412 4 0 if (mp4->sample_to_chunk) Safefree(mp4->sample_to_chunk);
413 4 0 if (mp4->sample_byte_size) Safefree(mp4->sample_byte_size);
414 4 0 if (mp4->chunk_offset) Safefree(mp4->chunk_offset);
421 103 0 while ( (box_size = _mp4_read_box(mp4)) > 0 ) {
425 4 99 if (mp4->audio_offset >= mp4->file_size)
432 0 4 if (mp4->buf) {
441 4 1 if (mp4->new_stts) SvREFCNT_dec(mp4->new_stts);
442 4 1 if (mp4->new_stsc) SvREFCNT_dec(mp4->new_stsc);
443 4 1 if (mp4->new_stsz) SvREFCNT_dec(mp4->new_stsz);
444 4 1 if (mp4->new_stco) SvREFCNT_dec(mp4->new_stco);
447 5 0 if (mp4->time_to_sample) Safefree(mp4->time_to_sample);
448 5 0 if (mp4->sample_to_chunk) Safefree(mp4->sample_to_chunk);
449 5 0 if (mp4->sample_byte_size) Safefree(mp4->sample_byte_size);
450 5 0 if (mp4->chunk_offset) Safefree(mp4->chunk_offset);
457 1 4 if (ret == -1) {
499 495 0 while ( (box_size = _mp4_read_box(mp4)) > 0 ) {
503 17 478 if (mp4->audio_offset >= file_size)
510 4 13 if ( !my_hv_exists(info, "avg_bitrate") ) {
512 4 0 if (entry) {
514 4 0 if (audio_offset) {
525 15 2 if (!mp4->dlna_invalid && mp4->samplerate && mp4->bitrate && mp4->channels) {
15 0 if (!mp4->dlna_invalid && mp4->samplerate && mp4->bitrate && mp4->channels) {
15 0 if (!mp4->dlna_invalid && mp4->samplerate && mp4->bitrate && mp4->channels) {
15 0 if (!mp4->dlna_invalid && mp4->samplerate && mp4->bitrate && mp4->channels) {
530 11 0 if (mp4->samplerate < 8000 || mp4->samplerate > 48000)
10 1 if (mp4->samplerate < 8000 || mp4->samplerate > 48000)
533 10 0 if (mp4->channels <= 2) {
534 8 2 if (mp4->bitrate <= 192000)
536 2 0 else if (mp4->bitrate <= 320000)
538 0 0 else if (mp4->bitrate <= 576000)
541 0 0 else if (mp4->channels <= 6) {
542 0 0 if (mp4->bitrate <= 1440000)
552 0 0 if (mp4->samplerate < 8000)
555 0 0 if (mp4->samplerate <= 48000) {
556 0 0 if (mp4->channels <= 2 && mp4->bitrate <= 576000)
0 0 if (mp4->channels <= 2 && mp4->bitrate <= 576000)
559 0 0 else if (mp4->samplerate <= 96000) {
560 0 0 if (mp4->channels <= 6 && mp4->bitrate <= 2880000)
0 0 if (mp4->channels <= 6 && mp4->bitrate <= 2880000)
562 0 0 else if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
0 0 else if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
571 0 0 if (mp4->samplerate < 8000)
574 0 0 if (mp4->samplerate <= 24000) {
575 0 0 if (mp4->channels > 2)
578 0 0 if (mp4->bitrate <= 128000)
580 0 0 else if (mp4->bitrate <= 320000)
582 0 0 else if (mp4->bitrate <= 576000)
585 0 0 else if (mp4->samplerate <= 48000) {
586 0 0 if (mp4->channels <= 2 && mp4->bitrate <= 576000)
0 0 if (mp4->channels <= 2 && mp4->bitrate <= 576000)
588 0 0 else if (mp4->channels <= 6 && mp4->bitrate <= 1440000)
0 0 else if (mp4->channels <= 6 && mp4->bitrate <= 1440000)
590 0 0 else if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
0 0 else if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
593 0 0 else if (mp4->samplerate <= 96000) {
594 0 0 if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
0 0 if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
604 0 0 if (mp4->samplerate < 8000)
607 0 0 if (mp4->samplerate <= 24000) {
608 0 0 if (mp4->channels > 2)
611 0 0 if (mp4->bitrate <= 128000)
613 0 0 else if (mp4->bitrate <= 320000)
615 0 0 else if (mp4->bitrate <= 576000)
618 0 0 else if (mp4->samplerate <= 48000) {
619 0 0 if (mp4->channels <= 2 && mp4->bitrate <= 576000)
0 0 if (mp4->channels <= 2 && mp4->bitrate <= 576000)
621 0 0 else if (mp4->channels <= 6 && mp4->bitrate <= 1440000)
0 0 else if (mp4->channels <= 6 && mp4->bitrate <= 1440000)
623 0 0 else if (mp4->channels <= 6 && mp4->bitrate <= 2880000)
0 0 else if (mp4->channels <= 6 && mp4->bitrate <= 2880000)
625 0 0 else if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
0 0 else if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
628 0 0 else if (mp4->samplerate <= 96000) {
629 0 0 if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
0 0 if (mp4->channels <= 8 && mp4->bitrate <= 4032000)
638 0 0 if (mp4->samplerate < 16000 || mp4->samplerate > 48000)
0 0 if (mp4->samplerate < 16000 || mp4->samplerate > 48000)
641 0 0 if (mp4->bitrate > 128000)
644 0 0 if (mp4->channels <= 2)
646 0 0 else if (mp4->channels <= 6)
672 0 598 if ( !_check_buf(mp4->infile, mp4->buf, 8, MP4_BLOCK_SIZE) ) {
683 0 598 if (size == 1) {
684 0 0 if ( !_check_buf(mp4->infile, mp4->buf, 8, MP4_BLOCK_SIZE) ) {
691 598 0 if (size == 0) {
695 0 598 else if (size < mp4->hsize) {
708 1 597 if (size == mp4->hsize) {
713 103 494 if (mp4->seekhdr) {
718 31 72 FOURCC_EQ(type, "moov")
4 27 FOURCC_EQ(type, "moov")
4 0 FOURCC_EQ(type, "moov")
4 0 FOURCC_EQ(type, "moov")
0 4 FOURCC_EQ(type, "moov")
719 8 91 || FOURCC_EQ(type, "trak")
4 4 || FOURCC_EQ(type, "trak")
4 0 || FOURCC_EQ(type, "trak")
4 0 || FOURCC_EQ(type, "trak")
0 4 || FOURCC_EQ(type, "trak")
720 27 68 || FOURCC_EQ(type, "mdia")
12 15 || FOURCC_EQ(type, "mdia")
12 0 || FOURCC_EQ(type, "mdia")
12 0 || FOURCC_EQ(type, "mdia")
8 4 || FOURCC_EQ(type, "mdia")
721 23 68 || FOURCC_EQ(type, "minf")
4 19 || FOURCC_EQ(type, "minf")
4 0 || FOURCC_EQ(type, "minf")
4 0 || FOURCC_EQ(type, "minf")
0 4 || FOURCC_EQ(type, "minf")
722 28 59 || FOURCC_EQ(type, "stbl")
24 4 || FOURCC_EQ(type, "stbl")
24 0 || FOURCC_EQ(type, "stbl")
24 0 || FOURCC_EQ(type, "stbl")
4 20 || FOURCC_EQ(type, "stbl")
731 24 59 else if ( FOURCC_EQ(type, "stts") ) {
20 4 else if ( FOURCC_EQ(type, "stts") ) {
20 0 else if ( FOURCC_EQ(type, "stts") ) {
20 0 else if ( FOURCC_EQ(type, "stts") ) {
4 16 else if ( FOURCC_EQ(type, "stts") ) {
735 20 59 else if ( FOURCC_EQ(type, "stsc") ) {
16 4 else if ( FOURCC_EQ(type, "stsc") ) {
16 0 else if ( FOURCC_EQ(type, "stsc") ) {
16 0 else if ( FOURCC_EQ(type, "stsc") ) {
4 12 else if ( FOURCC_EQ(type, "stsc") ) {
739 16 59 else if ( FOURCC_EQ(type, "stsz") ) {
12 4 else if ( FOURCC_EQ(type, "stsz") ) {
12 0 else if ( FOURCC_EQ(type, "stsz") ) {
12 0 else if ( FOURCC_EQ(type, "stsz") ) {
4 8 else if ( FOURCC_EQ(type, "stsz") ) {
743 12 59 else if ( FOURCC_EQ(type, "stco") ) {
8 4 else if ( FOURCC_EQ(type, "stco") ) {
8 0 else if ( FOURCC_EQ(type, "stco") ) {
8 0 else if ( FOURCC_EQ(type, "stco") ) {
4 4 else if ( FOURCC_EQ(type, "stco") ) {
754 8 59 if ( FOURCC_EQ(type, "stsd") ) {
4 4 if ( FOURCC_EQ(type, "stsd") ) {
4 0 if ( FOURCC_EQ(type, "stsd") ) {
4 0 if ( FOURCC_EQ(type, "stsd") ) {
4 0 if ( FOURCC_EQ(type, "stsd") ) {
759 19 44 else if ( FOURCC_EQ(type, "mp4a") ) {
3 16 else if ( FOURCC_EQ(type, "mp4a") ) {
3 0 else if ( FOURCC_EQ(type, "mp4a") ) {
3 0 else if ( FOURCC_EQ(type, "mp4a") ) {
3 0 else if ( FOURCC_EQ(type, "mp4a") ) {
764 16 44 else if ( FOURCC_EQ(type, "meta") ) {
4 12 else if ( FOURCC_EQ(type, "meta") ) {
4 0 else if ( FOURCC_EQ(type, "meta") ) {
4 0 else if ( FOURCC_EQ(type, "meta") ) {
4 0 else if ( FOURCC_EQ(type, "meta") ) {
770 3 53 !FOURCC_EQ(type, "edts")
0 3 !FOURCC_EQ(type, "edts")
0 0 !FOURCC_EQ(type, "edts")
0 0 !FOURCC_EQ(type, "edts")
0 0 !FOURCC_EQ(type, "edts")
771 8 48 && !FOURCC_EQ(type, "dinf")
4 4 && !FOURCC_EQ(type, "dinf")
4 0 && !FOURCC_EQ(type, "dinf")
4 0 && !FOURCC_EQ(type, "dinf")
0 4 && !FOURCC_EQ(type, "dinf")
772 4 48 && !FOURCC_EQ(type, "udta")
4 0 && !FOURCC_EQ(type, "udta")
4 0 && !FOURCC_EQ(type, "udta")
4 0 && !FOURCC_EQ(type, "udta")
0 4 && !FOURCC_EQ(type, "udta")
773 12 36 && !FOURCC_EQ(type, "mdat")
8 4 && !FOURCC_EQ(type, "mdat")
8 0 && !FOURCC_EQ(type, "mdat")
8 0 && !FOURCC_EQ(type, "mdat")
4 4 && !FOURCC_EQ(type, "mdat")
775 0 44 if ( !_check_buf(mp4->infile, mp4->buf, size - 8, MP4_BLOCK_SIZE) ) {
791 55 542 if ( FOURCC_EQ(type, "ftyp") ) {
21 34 if ( FOURCC_EQ(type, "ftyp") ) {
21 0 if ( FOURCC_EQ(type, "ftyp") ) {
21 0 if ( FOURCC_EQ(type, "ftyp") ) {
21 0 if ( FOURCC_EQ(type, "ftyp") ) {
792 0 21 if ( !_mp4_parse_ftyp(mp4) ) {
798 174 402 FOURCC_EQ(type, "moov")
21 153 FOURCC_EQ(type, "moov")
21 0 FOURCC_EQ(type, "moov")
21 0 FOURCC_EQ(type, "moov")
0 21 FOURCC_EQ(type, "moov")
799 20 535 || FOURCC_EQ(type, "edts")
0 20 || FOURCC_EQ(type, "edts")
0 0 || FOURCC_EQ(type, "edts")
0 0 || FOURCC_EQ(type, "edts")
0 0 || FOURCC_EQ(type, "edts")
800 153 402 || FOURCC_EQ(type, "mdia")
68 85 || FOURCC_EQ(type, "mdia")
68 0 || FOURCC_EQ(type, "mdia")
68 0 || FOURCC_EQ(type, "mdia")
44 24 || FOURCC_EQ(type, "mdia")
801 129 402 || FOURCC_EQ(type, "minf")
24 105 || FOURCC_EQ(type, "minf")
24 0 || FOURCC_EQ(type, "minf")
24 0 || FOURCC_EQ(type, "minf")
0 24 || FOURCC_EQ(type, "minf")
802 48 459 || FOURCC_EQ(type, "dinf")
24 24 || FOURCC_EQ(type, "dinf")
24 0 || FOURCC_EQ(type, "dinf")
24 0 || FOURCC_EQ(type, "dinf")
0 24 || FOURCC_EQ(type, "dinf")
803 167 316 || FOURCC_EQ(type, "stbl")
144 23 || FOURCC_EQ(type, "stbl")
144 0 || FOURCC_EQ(type, "stbl")
144 0 || FOURCC_EQ(type, "stbl")
120 24 || FOURCC_EQ(type, "stbl")
804 21 438 || FOURCC_EQ(type, "udta")
21 0 || FOURCC_EQ(type, "udta")
21 0 || FOURCC_EQ(type, "udta")
21 0 || FOURCC_EQ(type, "udta")
0 21 || FOURCC_EQ(type, "udta")
805 51 387 || FOURCC_EQ(type, "trak")
27 24 || FOURCC_EQ(type, "trak")
27 0 || FOURCC_EQ(type, "trak")
27 0 || FOURCC_EQ(type, "trak")
24 3 || FOURCC_EQ(type, "trak")
811 24 138 if ( FOURCC_EQ(type, "trak") ) {
24 0 if ( FOURCC_EQ(type, "trak") ) {
24 0 if ( FOURCC_EQ(type, "trak") ) {
24 0 if ( FOURCC_EQ(type, "trak") ) {
24 0 if ( FOURCC_EQ(type, "trak") ) {
816 105 309 else if ( FOURCC_EQ(type, "mvhd") ) {
21 84 else if ( FOURCC_EQ(type, "mvhd") ) {
21 0 else if ( FOURCC_EQ(type, "mvhd") ) {
21 0 else if ( FOURCC_EQ(type, "mvhd") ) {
21 0 else if ( FOURCC_EQ(type, "mvhd") ) {
819 0 21 if ( !_mp4_parse_mvhd(mp4) ) {
824 27 366 else if ( FOURCC_EQ(type, "tkhd") ) {
24 3 else if ( FOURCC_EQ(type, "tkhd") ) {
24 0 else if ( FOURCC_EQ(type, "tkhd") ) {
24 0 else if ( FOURCC_EQ(type, "tkhd") ) {
24 0 else if ( FOURCC_EQ(type, "tkhd") ) {
825 0 24 if ( !_mp4_parse_tkhd(mp4) ) {
830 84 285 else if ( FOURCC_EQ(type, "mdhd") ) {
44 40 else if ( FOURCC_EQ(type, "mdhd") ) {
44 0 else if ( FOURCC_EQ(type, "mdhd") ) {
44 0 else if ( FOURCC_EQ(type, "mdhd") ) {
24 20 else if ( FOURCC_EQ(type, "mdhd") ) {
831 0 24 if ( !_mp4_parse_mdhd(mp4) ) {
836 27 318 else if ( FOURCC_EQ(type, "hdlr") ) {
24 3 else if ( FOURCC_EQ(type, "hdlr") ) {
24 0 else if ( FOURCC_EQ(type, "hdlr") ) {
24 0 else if ( FOURCC_EQ(type, "hdlr") ) {
24 0 else if ( FOURCC_EQ(type, "hdlr") ) {
837 0 24 if ( !_mp4_parse_hdlr(mp4) ) {
842 143 178 else if ( FOURCC_EQ(type, "stsd") ) {
120 23 else if ( FOURCC_EQ(type, "stsd") ) {
120 0 else if ( FOURCC_EQ(type, "stsd") ) {
120 0 else if ( FOURCC_EQ(type, "stsd") ) {
24 96 else if ( FOURCC_EQ(type, "stsd") ) {
843 0 24 if ( !_mp4_parse_stsd(mp4) ) {
851 60 237 else if ( FOURCC_EQ(type, "mp4a") ) {
20 40 else if ( FOURCC_EQ(type, "mp4a") ) {
20 0 else if ( FOURCC_EQ(type, "mp4a") ) {
20 0 else if ( FOURCC_EQ(type, "mp4a") ) {
20 0 else if ( FOURCC_EQ(type, "mp4a") ) {
852 0 20 if ( !_mp4_parse_mp4a(mp4) ) {
860 3 274 else if ( FOURCC_EQ(type, "alac") ) {
3 0 else if ( FOURCC_EQ(type, "alac") ) {
3 0 else if ( FOURCC_EQ(type, "alac") ) {
3 0 else if ( FOURCC_EQ(type, "alac") ) {
3 0 else if ( FOURCC_EQ(type, "alac") ) {
861 0 3 if ( !_mp4_parse_alac(mp4) ) {
870 24 250 else if ( FOURCC_EQ(type, "drms") ) {
24 0 else if ( FOURCC_EQ(type, "drms") ) {
24 0 else if ( FOURCC_EQ(type, "drms") ) {
24 0 else if ( FOURCC_EQ(type, "drms") ) {
0 24 else if ( FOURCC_EQ(type, "drms") ) {
879 20 254 else if ( FOURCC_EQ(type, "esds") ) {
20 0 else if ( FOURCC_EQ(type, "esds") ) {
20 0 else if ( FOURCC_EQ(type, "esds") ) {
20 0 else if ( FOURCC_EQ(type, "esds") ) {
20 0 else if ( FOURCC_EQ(type, "esds") ) {
880 0 20 if ( !_mp4_parse_esds(mp4) ) {
885 119 135 else if ( FOURCC_EQ(type, "stts") ) {
96 23 else if ( FOURCC_EQ(type, "stts") ) {
96 0 else if ( FOURCC_EQ(type, "stts") ) {
96 0 else if ( FOURCC_EQ(type, "stts") ) {
24 72 else if ( FOURCC_EQ(type, "stts") ) {
886 10 14 if ( mp4->seeking && mp4->track_count == 1 ) {
9 1 if ( mp4->seeking && mp4->track_count == 1 ) {
887 0 9 if ( !_mp4_parse_stts(mp4) ) {
897 95 135 else if ( FOURCC_EQ(type, "stsc") ) {
72 23 else if ( FOURCC_EQ(type, "stsc") ) {
72 0 else if ( FOURCC_EQ(type, "stsc") ) {
72 0 else if ( FOURCC_EQ(type, "stsc") ) {
24 48 else if ( FOURCC_EQ(type, "stsc") ) {
898 10 14 if ( mp4->seeking && mp4->track_count == 1 ) {
9 1 if ( mp4->seeking && mp4->track_count == 1 ) {
899 0 9 if ( !_mp4_parse_stsc(mp4) ) {
909 71 135 else if ( FOURCC_EQ(type, "stsz") ) {
48 23 else if ( FOURCC_EQ(type, "stsz") ) {
48 0 else if ( FOURCC_EQ(type, "stsz") ) {
48 0 else if ( FOURCC_EQ(type, "stsz") ) {
24 24 else if ( FOURCC_EQ(type, "stsz") ) {
910 10 14 if ( mp4->seeking && mp4->track_count == 1 ) {
9 1 if ( mp4->seeking && mp4->track_count == 1 ) {
911 0 9 if ( !_mp4_parse_stsz(mp4) ) {
921 47 135 else if ( FOURCC_EQ(type, "stco") ) {
24 23 else if ( FOURCC_EQ(type, "stco") ) {
24 0 else if ( FOURCC_EQ(type, "stco") ) {
24 0 else if ( FOURCC_EQ(type, "stco") ) {
24 0 else if ( FOURCC_EQ(type, "stco") ) {
922 10 14 if ( mp4->seeking && mp4->track_count == 1 ) {
9 1 if ( mp4->seeking && mp4->track_count == 1 ) {
923 0 9 if ( !_mp4_parse_stco(mp4) ) {
933 40 118 else if ( FOURCC_EQ(type, "meta") ) {
20 20 else if ( FOURCC_EQ(type, "meta") ) {
20 0 else if ( FOURCC_EQ(type, "meta") ) {
20 0 else if ( FOURCC_EQ(type, "meta") ) {
20 0 else if ( FOURCC_EQ(type, "meta") ) {
935 0 20 if ( !meta_size ) {
945 25 113 else if ( FOURCC_EQ(type, "ilst") ) {
20 5 else if ( FOURCC_EQ(type, "ilst") ) {
20 0 else if ( FOURCC_EQ(type, "ilst") ) {
20 0 else if ( FOURCC_EQ(type, "ilst") ) {
20 0 else if ( FOURCC_EQ(type, "ilst") ) {
946 0 20 if ( !_mp4_parse_ilst(mp4) ) {
951 20 98 else if ( FOURCC_EQ(type, "mdat") ) {
20 0 else if ( FOURCC_EQ(type, "mdat") ) {
20 0 else if ( FOURCC_EQ(type, "mdat") ) {
20 0 else if ( FOURCC_EQ(type, "mdat") ) {
20 0 else if ( FOURCC_EQ(type, "mdat") ) {
957 2 18 if ( !mp4->seen_moov ) {
972 181 416 if (skip) {
984 0 21 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
995 0 21 if (mp4->rsize % 4) {
1000 74 21 while (mp4->rsize > 0) {
1017 0 21 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1024 21 0 if (version == 0) { // 32-bit values
1033 0 0 else if (version == 1) { // 64-bit values
1064 0 24 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1074 24 0 if (version == 0) { // 32-bit values
1087 0 0 else if (version == 1) { // 64-bit values
1110 0 24 if (width > 0) {
1116 0 24 if (height > 0) {
1134 0 24 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1141 24 0 if (version == 0) { // 32-bit values
1149 24 0 if ( my_hv_exists( mp4->info, "song_length_ms" ) ) {
1156 0 0 else if (version == 1) { // 64-bit values
1164 0 0 if ( my_hv_exists( mp4->info, "song_length_ms" ) ) {
1189 0 24 if (!trackinfo) {
1193 0 24 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1220 0 24 if ( !_check_buf(mp4->infile, mp4->buf, 8, MP4_BLOCK_SIZE) ) {
1237 0 20 if ( !_check_buf(mp4->infile, mp4->buf, 28, MP4_BLOCK_SIZE) ) {
1269 0 20 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1280 20 0 if (buffer_get_char(mp4->buf) == 0x03) {
1282 0 20 if ( _mp4_descr_length(mp4->buf) < 5 + 15 ) {
1295 0 20 if (buffer_get_char(mp4->buf) != 0x04) {
1300 0 20 if ( _mp4_descr_length(mp4->buf) < 13 ) {
1312 16 4 if (avg_bitrate) {
1313 3 13 if ( my_hv_exists(mp4->info, "avg_bitrate") ) {
1322 0 20 if (buffer_get_char(mp4->buf) != 0x05) {
1329 20 0 if (len > 0) {
1337 2 18 if ( aot == 0x1F ) {
1349 0 20 if (samplerate == 0xF) { // XXX need test file with 24-bit samplerate field
1363 2 18 if (aot == AAC_SLS) {
1371 17 1 else if (aot == AAC_HE || aot == AAC_PS) {
0 17 else if (aot == AAC_HE || aot == AAC_PS) {
1375 0 1 if (samplerate == 0xF) { // XXX need test file with 24-bit samplerate field
1396 0 20 if (buffer_get_char(mp4->buf) != 0x06) {
1403 0 20 if (buffer_get_char(mp4->buf) != 0x02) {
1415 0 3 if ( !_check_buf(mp4->infile, mp4->buf, 28, MP4_BLOCK_SIZE) ) {
1445 0 9 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1455 0 9 New(0,
1461 0 9 if ( !mp4->time_to_sample ) {
1466 11 9 for (i = 0; i < mp4->num_time_to_samples; i++) {
1485 0 9 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1495 0 9 New(0,
1501 0 9 if ( !mp4->sample_to_chunk ) {
1506 11 9 for (i = 0; i < mp4->num_sample_to_chunks; i++) {
1527 0 9 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1535 0 9 if ( buffer_get_int(mp4->buf) != 0 ) {
1545 0 9 New(0,
1551 0 9 if ( !mp4->sample_byte_size ) {
1556 32510 9 for (i = 0; i < mp4->num_sample_byte_sizes; i++) {
1559 0 32510 if (v > 0x0000ffff) {
1577 0 9 if ( !_check_buf(mp4->infile, mp4->buf, mp4->rsize, MP4_BLOCK_SIZE) ) {
1587 0 9 New(0,
1593 0 9 if ( !mp4->chunk_offset ) {
1598 21848 9 for (i = 0; i < mp4->num_chunk_offsets; i++) {
1613 0 20 if ( !_check_buf(mp4->infile, mp4->buf, 12, MP4_BLOCK_SIZE) ) {
1626 20 0 if ( !FOURCC_EQ(type, "hdlr") ) {
20 0 if ( !FOURCC_EQ(type, "hdlr") ) {
20 0 if ( !FOURCC_EQ(type, "hdlr") ) {
20 0 if ( !FOURCC_EQ(type, "hdlr") ) {
0 20 if ( !FOURCC_EQ(type, "hdlr") ) {
1631 0 20 if ( !_check_buf(mp4->infile, mp4->buf, hdlr_size - 8, MP4_BLOCK_SIZE) ) {
1643 396 20 while (mp4->rsize) {
1647 0 396 if ( !_check_buf(mp4->infile, mp4->buf, 8, MP4_BLOCK_SIZE) ) {
1666 67 329 if ( FOURCC_EQ(key, "----") ) {
67 0 if ( FOURCC_EQ(key, "----") ) {
67 0 if ( FOURCC_EQ(key, "----") ) {
67 0 if ( FOURCC_EQ(key, "----") ) {
67 0 if ( FOURCC_EQ(key, "----") ) {
1668 0 67 if ( !_mp4_parse_ilst_custom(mp4, size - 8) ) {
1676 0 329 if ( !_check_buf(mp4->infile, mp4->buf, 8, MP4_BLOCK_SIZE) ) {
1686 329 0 if ( bsize <= size - 8 ) {
1690 329 0 if ( !FOURCC_EQ(bptr, "data") ) {
329 0 if ( !FOURCC_EQ(bptr, "data") ) {
329 0 if ( !FOURCC_EQ(bptr, "data") ) {
329 0 if ( !FOURCC_EQ(bptr, "data") ) {
0 329 if ( !FOURCC_EQ(bptr, "data") ) {
1698 0 329 if ( !_mp4_parse_ilst_data(mp4, bsize - 8, skey) ) {
1706 2 327 if ( bsize < size - 8 ) {
1731 29 371 if ( FOURCC_EQ(ckey, "COVR") && _env_true("AUDIO_SCAN_NO_ARTWORK") ) {
13 16 if ( FOURCC_EQ(ckey, "COVR") && _env_true("AUDIO_SCAN_NO_ARTWORK") ) {
13 0 if ( FOURCC_EQ(ckey, "COVR") && _env_true("AUDIO_SCAN_NO_ARTWORK") ) {
13 0 if ( FOURCC_EQ(ckey, "COVR") && _env_true("AUDIO_SCAN_NO_ARTWORK") ) {
11 2 if ( FOURCC_EQ(ckey, "COVR") && _env_true("AUDIO_SCAN_NO_ARTWORK") ) {
1 10 if ( FOURCC_EQ(ckey, "COVR") && _env_true("AUDIO_SCAN_NO_ARTWORK") ) {
1741 0 399 if ( !_check_buf(mp4->infile, mp4->buf, size, MP4_BLOCK_SIZE) ) {
1753 351 48 if ( !flags || flags == 21 ) {
60 291 if ( !flags || flags == 21 ) {
1754 44 64 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
15 29 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
15 0 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
15 0 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
0 15 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
13 80 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
13 0 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
13 0 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
13 0 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
13 0 if ( FOURCC_EQ( SvPVX(key), "TRKN" ) || FOURCC_EQ( SvPVX(key), "DISK" ) ) {
1764 27 1 if (size > 12) {
1771 26 2 if (total) {
1774 1 1 else if (num) {
1780 9 71 else if ( FOURCC_EQ( SvPVX(key), "GNRE" ) ) {
9 0 else if ( FOURCC_EQ( SvPVX(key), "GNRE" ) ) {
9 0 else if ( FOURCC_EQ( SvPVX(key), "GNRE" ) ) {
9 0 else if ( FOURCC_EQ( SvPVX(key), "GNRE" ) ) {
9 0 else if ( FOURCC_EQ( SvPVX(key), "GNRE" ) ) {
1785 9 0 if (genre_num > 0 && genre_num < NGENRES + 1) {
9 0 if (genre_num > 0 && genre_num < NGENRES + 1) {
1796 27 44 if (dsize == 1) {
1799 15 29 else if (dsize == 2) {
1802 18 11 else if (dsize == 4) {
1805 1 10 else if (dsize == 8) {
1819 124 167 if ( ckey[0] == 0xA9 ) {
1830 100 263 if ( my_hv_exists( mp4->tags, (char *)ckey ) ) {
1832 100 0 if (entry != NULL) {
1833 7 93 if ( SvROK(*entry) && SvTYPE(SvRV(*entry)) == SVt_PVAV ) {
7 0 if ( SvROK(*entry) && SvTYPE(SvRV(*entry)) == SVt_PVAV ) {
1857 205 67 while (size) {
1862 0 205 if ( !_check_buf(mp4->infile, mp4->buf, 8, MP4_BLOCK_SIZE) ) {
1874 67 138 if ( FOURCC_EQ(type, "name") ) {
67 0 if ( FOURCC_EQ(type, "name") ) {
67 0 if ( FOURCC_EQ(type, "name") ) {
67 0 if ( FOURCC_EQ(type, "name") ) {
67 0 if ( FOURCC_EQ(type, "name") ) {
1876 0 67 if ( !_check_buf(mp4->infile, mp4->buf, bsize, MP4_BLOCK_SIZE) ) {
1888 71 67 else if ( FOURCC_EQ(type, "data") ) {
71 0 else if ( FOURCC_EQ(type, "data") ) {
71 0 else if ( FOURCC_EQ(type, "data") ) {
71 0 else if ( FOURCC_EQ(type, "data") ) {
71 0 else if ( FOURCC_EQ(type, "data") ) {
1889 0 71 if (!key) {
1894 0 71 if ( !_mp4_parse_ilst_data(mp4, bsize - 8, key) ) {
1901 0 67 if ( !_check_buf(mp4->infile, mp4->buf, bsize - 8, MP4_BLOCK_SIZE) ) {
1925 67 0 if (entry != NULL) {
1933 74 0 for (i = 0; av_len(tracks) >= 0 && i <= av_len(tracks); i++) {
74 0 for (i = 0; av_len(tracks) >= 0 && i <= av_len(tracks); i++) {
1935 74 0 if (info != NULL) {
1940 74 0 if (tid != NULL) {
1941 67 7 if ( SvIV(*tid) == mp4->current_track ) {
1962 228 80 } while ( (b & 0x80) && num_bytes < 4 );
228 0 } while ( (b & 0x80) && num_bytes < 4 );
1970 153 31 if ( buffer_len(mp4->buf) >= size ) {
1989 2538 0 for (i = mp4->num_sample_to_chunks - 1; i >= 0; i--) {
1990 1271 1267 if (mp4->sample_to_chunk[i].first_chunk <= chunk) {
2004 5 4 for (i = 0; i < mp4->num_time_to_samples; i++) {
2017 6342 0 for (i = 0; i < mp4->num_time_to_samples; i++) {
2019 6341 1 if (sample < co + delta) {