@@ -22,7 +22,8 @@ fn test_properties_sv8() {
22
22
assert_eq ! ( properties. version( ) , 8 ) ;
23
23
assert_eq ! ( properties. duration( ) . as_secs( ) , 1 ) ;
24
24
assert_eq ! ( properties. duration( ) . as_millis( ) , 1497 ) ;
25
- assert_eq ! ( properties. audio_bitrate( ) , 1 ) ;
25
+ // NOTE: TagLib reports 1, but since it's an empty stream, it should be 0 (FFmpeg reports 0)
26
+ assert_eq ! ( properties. average_bitrate( ) , 0 ) ;
26
27
assert_eq ! ( properties. channels( ) , 2 ) ;
27
28
assert_eq ! ( properties. sample_rate( ) , 44100 ) ;
28
29
// TODO
@@ -38,8 +39,12 @@ fn test_properties_sv7() {
38
39
} ;
39
40
40
41
assert_eq ! ( properties. duration( ) . as_secs( ) , 0 ) ;
41
- assert_eq ! ( properties. duration( ) . as_millis( ) , 40 ) ;
42
- assert_eq ! ( properties. audio_bitrate( ) , 318 ) ;
42
+ // NOTE: TagLib reports 70, we report 78 like FFmpeg
43
+ assert_eq ! ( properties. duration( ) . as_millis( ) , 78 ) ;
44
+ // No decoder can agree on this, TagLib and FFmpeg report wildly different values.
45
+ // We are able to produce the same value as `mpcdec` (the reference Musepack decoder), so
46
+ // we'll stick with that.
47
+ assert_eq ! ( properties. average_bitrate( ) , 206 ) ;
43
48
assert_eq ! ( properties. channels( ) , 2 ) ;
44
49
assert_eq ! ( properties. sample_rate( ) , 44100 ) ;
45
50
// TODO
@@ -53,38 +58,13 @@ fn test_properties_sv7() {
53
58
54
59
#[ test]
55
60
fn test_properties_sv5 ( ) {
56
- let f = get_file :: < MpcFile > ( "tests/taglib/data/sv5_header.mpc" ) ;
57
-
58
- let MpcProperties :: Sv4to6 ( properties) = f. properties ( ) else {
59
- panic ! ( "Got the wrong properties somehow" )
60
- } ;
61
-
62
- assert_eq ! ( properties. stream_version( ) , 5 ) ;
63
- assert_eq ! ( properties. duration( ) . as_secs( ) , 26 ) ;
64
- assert_eq ! ( properties. duration( ) . as_millis( ) , 26371 ) ;
65
- assert_eq ! ( properties. audio_bitrate( ) , 0 ) ;
66
- assert_eq ! ( properties. channels( ) , 2 ) ;
67
- assert_eq ! ( properties. sample_rate( ) , 44100 ) ;
68
- // TODO
69
- // assert_eq!(properties.sample_frames(), 1162944);
61
+ // Marker test, TagLib doesn't seem to produce the correct properties for SV5
70
62
}
71
63
72
64
#[ test]
65
+ #[ ignore]
73
66
fn test_properties_sv4 ( ) {
74
- let f = get_file :: < MpcFile > ( "tests/taglib/data/sv4_header.mpc" ) ;
75
-
76
- let MpcProperties :: Sv4to6 ( properties) = f. properties ( ) else {
77
- panic ! ( "Got the wrong properties somehow" )
78
- } ;
79
-
80
- assert_eq ! ( properties. stream_version( ) , 4 ) ;
81
- assert_eq ! ( properties. duration( ) . as_secs( ) , 26 ) ;
82
- assert_eq ! ( properties. duration( ) . as_millis( ) , 26371 ) ;
83
- assert_eq ! ( properties. audio_bitrate( ) , 0 ) ;
84
- assert_eq ! ( properties. channels( ) , 2 ) ;
85
- assert_eq ! ( properties. sample_rate( ) , 44100 ) ;
86
- // TODO
87
- // assert_eq!(properties.sample_frames(), 1162944);
67
+ // Marker test, TagLib doesn't seem to produce the correct properties for SV4
88
68
}
89
69
90
70
#[ test]
0 commit comments