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
4808c7ef
Commit
4808c7ef
authored
Jan 15, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encoder/{Vorbis,Opus}: use new/delete
parent
70711267
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
OpusEncoderPlugin.cxx
src/encoder/OpusEncoderPlugin.cxx
+7
-6
VorbisEncoderPlugin.cxx
src/encoder/VorbisEncoderPlugin.cxx
+7
-4
No files found.
src/encoder/OpusEncoderPlugin.cxx
View file @
4808c7ef
...
...
@@ -67,6 +67,10 @@ struct opus_encoder {
ogg_int64_t
packetno
;
ogg_int64_t
granulepos
;
opus_encoder
()
{
encoder_struct_init
(
&
encoder
,
&
opus_encoder_plugin
);
}
};
gcc_const
...
...
@@ -123,15 +127,12 @@ opus_encoder_configure(struct opus_encoder *encoder,
static
struct
encoder
*
opus_encoder_init
(
const
struct
config_param
*
param
,
GError
**
error
)
{
struct
opus_encoder
*
encoder
;
encoder
=
g_new
(
struct
opus_encoder
,
1
);
encoder_struct_init
(
&
encoder
->
encoder
,
&
opus_encoder_plugin
);
opus_encoder
*
encoder
=
new
opus_encoder
();
/* load configuration from "param" */
if
(
!
opus_encoder_configure
(
encoder
,
param
,
error
))
{
/* configuration has failed, roll back and return error */
g_free
(
encoder
)
;
delete
encoder
;
return
NULL
;
}
...
...
@@ -145,7 +146,7 @@ opus_encoder_finish(struct encoder *_encoder)
/* the real libopus cleanup was already performed by
opus_encoder_close(), so no real work here */
g_free
(
encoder
)
;
delete
encoder
;
}
static
bool
...
...
src/encoder/VorbisEncoderPlugin.cxx
View file @
4808c7ef
...
...
@@ -55,6 +55,10 @@ struct vorbis_encoder {
vorbis_info
vi
;
OggStream
stream
;
vorbis_encoder
()
{
encoder_struct_init
(
&
encoder
,
&
vorbis_encoder_plugin
);
}
};
static
inline
GQuark
...
...
@@ -120,13 +124,12 @@ vorbis_encoder_configure(struct vorbis_encoder *encoder,
static
struct
encoder
*
vorbis_encoder_init
(
const
struct
config_param
*
param
,
GError
**
error
)
{
struct
vorbis_encoder
*
encoder
=
g_new
(
struct
vorbis_encoder
,
1
);
encoder_struct_init
(
&
encoder
->
encoder
,
&
vorbis_encoder_plugin
);
vorbis_encoder
*
encoder
=
new
vorbis_encoder
();
/* load configuration from "param" */
if
(
!
vorbis_encoder_configure
(
encoder
,
param
,
error
))
{
/* configuration has failed, roll back and return error */
g_free
(
encoder
)
;
delete
encoder
;
return
nullptr
;
}
...
...
@@ -140,7 +143,7 @@ vorbis_encoder_finish(struct encoder *_encoder)
/* the real libvorbis/libogg cleanup was already performed by
vorbis_encoder_close(), so no real work here */
g_free
(
encoder
)
;
delete
encoder
;
}
static
bool
...
...
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