@@ -40,7 +40,7 @@ fn test_properties_aac_without_bitrate() {
40
40
assert_eq ! ( f. properties( ) . audio_bitrate( ) , 3 ) ;
41
41
assert_eq ! ( f. properties( ) . channels( ) , 2 ) ;
42
42
assert_eq ! ( f. properties( ) . sample_rate( ) , 44100 ) ;
43
- assert_eq ! ( f. properties( ) . bit_depth( ) , Some ( 16 ) ) ;
43
+ assert_eq ! ( f. properties( ) . bit_depth( ) , None ) ; // TagLib reports 16, but the stream is a lossy codec
44
44
assert ! ( !f. properties( ) . is_drm_protected( ) ) ;
45
45
assert_eq ! ( f. properties( ) . codec( ) , & Mp4Codec :: AAC ) ;
46
46
}
@@ -50,7 +50,7 @@ fn test_properties_alac() {
50
50
let f = get_file :: < Mp4File > ( "tests/taglib/data/empty_alac.m4a" ) ;
51
51
assert_eq ! ( f. properties( ) . duration( ) . as_secs( ) , 3 ) ;
52
52
assert_eq ! ( f. properties( ) . duration( ) . as_millis( ) , 3705 ) ;
53
- assert_eq ! ( f. properties( ) . audio_bitrate( ) , 3 ) ;
53
+ assert_eq ! ( f. properties( ) . audio_bitrate( ) , 2 ) ; // TagLib is off by one (reports 3)
54
54
assert_eq ! ( f. properties( ) . channels( ) , 2 ) ;
55
55
assert_eq ! ( f. properties( ) . sample_rate( ) , 44100 ) ;
56
56
assert_eq ! ( f. properties( ) . bit_depth( ) , Some ( 16 ) ) ;
@@ -72,10 +72,10 @@ fn test_properties_alac_without_bitrate() {
72
72
alac_data[ i] = 0 ;
73
73
}
74
74
75
- let f = Mp4File :: read_from ( & mut file , ParseOptions :: new ( ) ) . unwrap ( ) ;
75
+ let f = Mp4File :: read_from ( & mut std :: io :: Cursor :: new ( alac_data ) , ParseOptions :: new ( ) ) . unwrap ( ) ;
76
76
assert_eq ! ( f. properties( ) . duration( ) . as_secs( ) , 3 ) ;
77
77
assert_eq ! ( f. properties( ) . duration( ) . as_millis( ) , 3705 ) ;
78
- assert_eq ! ( f. properties( ) . audio_bitrate( ) , 3 ) ;
78
+ assert_eq ! ( f. properties( ) . audio_bitrate( ) , 2 ) ; // TagLib is off by one (reports 3)
79
79
assert_eq ! ( f. properties( ) . channels( ) , 2 ) ;
80
80
assert_eq ! ( f. properties( ) . sample_rate( ) , 44100 ) ;
81
81
assert_eq ! ( f. properties( ) . bit_depth( ) , Some ( 16 ) ) ;
@@ -88,10 +88,10 @@ fn test_properties_m4v() {
88
88
let f = get_file :: < Mp4File > ( "tests/taglib/data/blank_video.m4v" ) ;
89
89
assert_eq ! ( f. properties( ) . duration( ) . as_secs( ) , 0 ) ;
90
90
assert_eq ! ( f. properties( ) . duration( ) . as_millis( ) , 975 ) ;
91
- assert_eq ! ( f. properties( ) . audio_bitrate( ) , 96 ) ;
91
+ assert_eq ! ( f. properties( ) . audio_bitrate( ) , 95 ) ; // TagLib is off by one (reports 96)
92
92
assert_eq ! ( f. properties( ) . channels( ) , 2 ) ;
93
93
assert_eq ! ( f. properties( ) . sample_rate( ) , 44100 ) ;
94
- assert_eq ! ( f. properties( ) . bit_depth( ) , Some ( 16 ) ) ;
94
+ assert_eq ! ( f. properties( ) . bit_depth( ) , None ) ; // TagLib reports 16, but the stream is a lossy codec
95
95
assert ! ( !f. properties( ) . is_drm_protected( ) ) ;
96
96
assert_eq ! ( f. properties( ) . codec( ) , & Mp4Codec :: AAC ) ;
97
97
}
0 commit comments