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
28b47725
Commit
28b47725
authored
Oct 28, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3: use GLib allocation functions
This removes the need for util.h.
parent
56ebdf1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
mp3_plugin.c
src/decoder/mp3_plugin.c
+9
-11
No files found.
src/decoder/mp3_plugin.c
View file @
28b47725
...
...
@@ -18,9 +18,11 @@
#include "../decoder_api.h"
#include "../log.h"
#include "../utils.h"
#include "../conf.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
#include <mad.h>
...
...
@@ -263,10 +265,7 @@ static void mp3_parse_id3(struct mp3_data *data, size_t tagsize,
id3_data
=
data
->
stream
.
this_frame
;
mad_stream_skip
(
&
(
data
->
stream
),
tagsize
);
}
else
{
allocated
=
xmalloc
(
tagsize
);
if
(
!
allocated
)
goto
fail
;
allocated
=
g_malloc
(
tagsize
);
memcpy
(
allocated
,
data
->
stream
.
this_frame
,
count
);
mad_stream_skip
(
&
(
data
->
stream
),
count
);
...
...
@@ -313,8 +312,7 @@ static void mp3_parse_id3(struct mp3_data *data, size_t tagsize,
id3_tag_delete
(
id3_tag
);
fail:
if
(
allocated
)
free
(
allocated
);
g_free
(
allocated
);
}
#endif
...
...
@@ -732,8 +730,8 @@ mp3_decode_first_frame(struct mp3_data *data, struct tag **tag,
return
false
;
}
data
->
frame_offsets
=
x
malloc
(
sizeof
(
long
)
*
data
->
max_frames
);
data
->
times
=
x
malloc
(
sizeof
(
mad_timer_t
)
*
data
->
max_frames
);
data
->
frame_offsets
=
g_
malloc
(
sizeof
(
long
)
*
data
->
max_frames
);
data
->
times
=
g_
malloc
(
sizeof
(
mad_timer_t
)
*
data
->
max_frames
);
return
true
;
}
...
...
@@ -744,8 +742,8 @@ static void mp3_data_finish(struct mp3_data *data)
mad_frame_finish
(
&
data
->
frame
);
mad_stream_finish
(
&
data
->
stream
);
if
(
data
->
frame_offsets
)
free
(
data
->
frame_offsets
);
if
(
data
->
times
)
free
(
data
->
times
);
g_
free
(
data
->
frame_offsets
);
g_
free
(
data
->
times
);
}
/* this is primarily used for getting total time for tags */
...
...
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