Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Strogin
flac
Commits
999be3b9
Commit
999be3b9
authored
Jun 10, 2002
by
Josh Coalson
Browse files
last batch of changes and fixes based on the libFLAC++ unit tests
parent
02783cd1
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
include/FLAC++/metadata.h
View file @
999be3b9
...
...
@@ -454,7 +454,7 @@ namespace FLAC {
bool
is_valid
()
const
;
void
init
(
Chain
*
chain
);
void
init
(
Chain
&
chain
);
bool
next
();
bool
prev
();
...
...
include/FLAC/metadata.h
View file @
999be3b9
...
...
@@ -80,11 +80,10 @@ extern "C" {
* Only one routine to read the STREAMINFO. Skips any ID3v2 tag at the
* head of the file. Useful for file-based player plugins.
*
* Provide the address of a FLAC__StreamMetadata_StreamInfo object to
* fill.
* Provide the address of a FLAC__StreamMetadata object to fill.
*/
FLAC__bool
FLAC__metadata_get_streaminfo
(
const
char
*
filename
,
FLAC__StreamMetadata
_StreamInfo
*
streaminfo
);
FLAC__bool
FLAC__metadata_get_streaminfo
(
const
char
*
filename
,
FLAC__StreamMetadata
*
streaminfo
);
/***********************************************************************
...
...
src/libFLAC++/metadata.cc
View file @
999be3b9
...
...
@@ -749,7 +749,7 @@ namespace FLAC {
::
FLAC__StreamMetadata
s
;
if
(
::
FLAC__metadata_get_streaminfo
(
filename
,
&
s
.
data
.
stream_info
))
{
if
(
::
FLAC__metadata_get_streaminfo
(
filename
,
&
s
))
{
streaminfo
=
s
;
return
true
;
}
...
...
@@ -929,12 +929,11 @@ namespace FLAC {
return
0
!=
iterator_
;
}
void
Iterator
::
init
(
Chain
*
chain
)
void
Iterator
::
init
(
Chain
&
chain
)
{
FLAC__ASSERT
(
0
!=
chain
);
FLAC__ASSERT
(
is_valid
());
FLAC__ASSERT
(
chain
->
is_valid
());
::
FLAC__metadata_iterator_init
(
iterator_
,
chain
->
chain_
);
FLAC__ASSERT
(
chain
.
is_valid
());
::
FLAC__metadata_iterator_init
(
iterator_
,
chain
.
chain_
);
}
bool
Iterator
::
next
()
...
...
src/libFLAC/metadata_iterators.c
View file @
999be3b9
...
...
@@ -118,10 +118,10 @@ static void error_callback_(const FLAC__FileDecoder *decoder, FLAC__StreamDecode
typedef
struct
{
FLAC__bool
got_error
;
FLAC__bool
got_streaminfo
;
FLAC__StreamMetadata
_StreamInfo
*
streaminfo
;
FLAC__StreamMetadata
*
streaminfo
;
}
level0_client_data
;
FLAC__bool
FLAC__metadata_get_streaminfo
(
const
char
*
filename
,
FLAC__StreamMetadata
_StreamInfo
*
streaminfo
)
FLAC__bool
FLAC__metadata_get_streaminfo
(
const
char
*
filename
,
FLAC__StreamMetadata
*
streaminfo
)
{
level0_client_data
cd
;
FLAC__FileDecoder
*
decoder
=
FLAC__file_decoder_new
();
...
...
@@ -171,7 +171,7 @@ void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMeta
(
void
)
decoder
;
if
(
metadata
->
type
==
FLAC__METADATA_TYPE_STREAMINFO
&&
0
!=
cd
->
streaminfo
)
{
*
(
cd
->
streaminfo
)
=
metadata
->
data
.
stream_info
;
*
(
cd
->
streaminfo
)
=
*
metadata
;
cd
->
got_streaminfo
=
true
;
}
}
...
...
src/plugin_winamp2/in_flac.c
View file @
999be3b9
...
...
@@ -211,7 +211,7 @@ int infoDlg(char *fn, HWND hwnd)
void
getfileinfo
(
char
*
filename
,
char
*
title
,
int
*
length_in_ms
)
{
id3v1_struct
tag
;
FLAC__StreamMetadata
_StreamInfo
streaminfo
;
FLAC__StreamMetadata
streaminfo
;
if
(
0
==
filename
)
{
filename
=
lastfn_
;
...
...
src/plugin_xmms/plugin.c
View file @
999be3b9
...
...
@@ -220,7 +220,7 @@ void FLAC_XMMS__cleanup()
void
FLAC_XMMS__get_song_info
(
char
*
filename
,
char
**
title
,
int
*
length_in_msec
)
{
id3v1_struct
tag
;
FLAC__StreamMetadata
_StreamInfo
streaminfo
;
FLAC__StreamMetadata
streaminfo
;
if
(
0
==
filename
)
filename
=
""
;
...
...
src/test_libFLAC++/metadata_manip.cc
View file @
999be3b9
This diff is collapsed.
Click to expand it.
src/test_libFLAC/metadata_manip.c
View file @
999be3b9
...
...
@@ -367,7 +367,7 @@ static FLAC__bool remove_file_(const char *filename)
static
FLAC__bool
test_level_0_
()
{
FLAC__StreamMetadata
_StreamInfo
streaminfo
;
FLAC__StreamMetadata
streaminfo
;
printf
(
"
\n\n
++++++ testing level 0 interface
\n
"
);
...
...
@@ -381,16 +381,16 @@ static FLAC__bool test_level_0_()
return
die_
(
"during FLAC__metadata_get_streaminfo()"
);
/* check to see if some basic data matches (c.f. generate_file_()) */
if
(
streaminfo
.
channels
!=
1
)
return
die_
(
"mismatch in streaminfo.channels"
);
if
(
streaminfo
.
bits_per_sample
!=
8
)
return
die_
(
"mismatch in streaminfo.bits_per_sample"
);
if
(
streaminfo
.
sample_rate
!=
44100
)
return
die_
(
"mismatch in streaminfo.sample_rate"
);
if
(
streaminfo
.
min_blocksize
!=
576
)
return
die_
(
"mismatch in streaminfo.min_blocksize"
);
if
(
streaminfo
.
max_blocksize
!=
576
)
return
die_
(
"mismatch in streaminfo.max_blocksize"
);
if
(
streaminfo
.
data
.
stream_info
.
channels
!=
1
)
return
die_
(
"mismatch in streaminfo.
data.stream_info.
channels"
);
if
(
streaminfo
.
data
.
stream_info
.
bits_per_sample
!=
8
)
return
die_
(
"mismatch in streaminfo.
data.stream_info.
bits_per_sample"
);
if
(
streaminfo
.
data
.
stream_info
.
sample_rate
!=
44100
)
return
die_
(
"mismatch in streaminfo.
data.stream_info.
sample_rate"
);
if
(
streaminfo
.
data
.
stream_info
.
min_blocksize
!=
576
)
return
die_
(
"mismatch in streaminfo.
data.stream_info.
min_blocksize"
);
if
(
streaminfo
.
data
.
stream_info
.
max_blocksize
!=
576
)
return
die_
(
"mismatch in streaminfo.
data.stream_info.
max_blocksize"
);
if
(
!
remove_file_
(
flacfile_
))
return
false
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment