Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
b6a2ffd3
Commit
b6a2ffd3
authored
Nov 10, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/flac: added function flac_data_deinit()
Clean up tag and replay_gain_info there.
parent
6a5f4651
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
17 deletions
+26
-17
_flac_common.c
src/decoder/_flac_common.c
+10
-0
_flac_common.h
src/decoder/_flac_common.h
+3
-0
flac_plugin.c
src/decoder/flac_plugin.c
+3
-8
oggflac_plugin.c
src/decoder/oggflac_plugin.c
+10
-9
No files found.
src/decoder/_flac_common.c
View file @
b6a2ffd3
...
...
@@ -40,6 +40,16 @@ flac_data_init(struct flac_data *data, struct decoder * decoder,
data
->
tag
=
NULL
;
}
void
flac_data_deinit
(
struct
flac_data
*
data
)
{
if
(
data
->
replay_gain_info
!=
NULL
)
replay_gain_info_free
(
data
->
replay_gain_info
);
if
(
data
->
tag
!=
NULL
)
tag_free
(
data
->
tag
);
}
static
void
flac_find_float_comment
(
const
FLAC__StreamMetadata
*
block
,
const
char
*
cmnt
,
float
*
fl
,
bool
*
found_r
)
...
...
src/decoder/_flac_common.h
View file @
b6a2ffd3
...
...
@@ -162,6 +162,9 @@ void
flac_data_init
(
struct
flac_data
*
data
,
struct
decoder
*
decoder
,
struct
input_stream
*
input_stream
);
void
flac_data_deinit
(
struct
flac_data
*
data
);
void
flac_metadata_common_cb
(
const
FLAC__StreamMetadata
*
block
,
struct
flac_data
*
data
);
...
...
src/decoder/flac_plugin.c
View file @
b6a2ffd3
...
...
@@ -485,10 +485,7 @@ flac_decode_internal(struct decoder * decoder,
}
fail:
if
(
data
.
replay_gain_info
)
replay_gain_info_free
(
data
.
replay_gain_info
);
tag_free
(
data
.
tag
);
flac_data_deinit
(
&
data
);
if
(
flac_dec
)
flac_delete
(
flac_dec
);
...
...
@@ -670,8 +667,7 @@ fail:
if
(
pathname
)
g_free
(
pathname
);
if
(
data
.
replay_gain_info
)
replay_gain_info_free
(
data
.
replay_gain_info
);
flac_data_deinit
(
&
data
);
if
(
flac_dec
)
flac_delete
(
flac_dec
);
...
...
@@ -793,8 +789,7 @@ flac_filedecode_internal(struct decoder* decoder,
}
fail:
if
(
data
.
replay_gain_info
)
replay_gain_info_free
(
data
.
replay_gain_info
);
flac_data_deinit
(
&
data
);
if
(
flac_dec
)
flac_delete
(
flac_dec
);
...
...
src/decoder/oggflac_plugin.c
View file @
b6a2ffd3
...
...
@@ -29,11 +29,8 @@
#include <assert.h>
#include <unistd.h>
static
void
oggflac_cleanup
(
struct
flac_data
*
data
,
OggFLAC__SeekableStreamDecoder
*
decoder
)
static
void
oggflac_cleanup
(
OggFLAC__SeekableStreamDecoder
*
decoder
)
{
if
(
data
->
replay_gain_info
)
replay_gain_info_free
(
data
->
replay_gain_info
);
if
(
decoder
)
OggFLAC__seekable_stream_decoder_delete
(
decoder
);
}
...
...
@@ -264,6 +261,7 @@ oggflac_tag_dup(const char *file)
struct
input_stream
input_stream
;
OggFLAC__SeekableStreamDecoder
*
decoder
;
struct
flac_data
data
;
struct
tag
*
tag
;
if
(
!
input_stream_open
(
&
input_stream
,
file
))
return
NULL
;
...
...
@@ -280,15 +278,17 @@ oggflac_tag_dup(const char *file)
* data.tag will be set or unset, that's all we care about */
decoder
=
full_decoder_init_and_read_metadata
(
&
data
,
1
);
oggflac_cleanup
(
&
data
,
decoder
);
oggflac_cleanup
(
decoder
);
input_stream_close
(
&
input_stream
);
if
(
!
tag_is_defined
(
data
.
tag
))
{
tag
_free
(
data
.
tag
)
;
if
(
tag_is_defined
(
data
.
tag
))
{
tag
=
data
.
tag
;
data
.
tag
=
NULL
;
}
return
data
.
tag
;
flac_data_deinit
(
&
data
);
return
tag
;
}
static
void
...
...
@@ -344,7 +344,8 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream)
}
fail:
oggflac_cleanup
(
&
data
,
decoder
);
oggflac_cleanup
(
decoder
);
flac_data_deinit
(
&
data
);
}
static
const
char
*
const
oggflac_suffixes
[]
=
{
"ogg"
,
"oga"
,
NULL
};
...
...
Write
Preview
Markdown
is supported
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