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
e0c2c77c
Commit
e0c2c77c
authored
Mar 22, 2013
by
Anton Khirnov
Committed by
Max Kellermann
Apr 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg decoder plugin: do not allocate an AVFrame on stack.
AVFrame must be allocated with avcodec_alloc_frame().
parent
46528783
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
NEWS
NEWS
+1
-0
ffmpeg_decoder_plugin.c
src/decoder/ffmpeg_decoder_plugin.c
+16
-3
No files found.
NEWS
View file @
e0c2c77c
...
...
@@ -3,6 +3,7 @@ ver 0.17.4 (2013/??/??)
- allow to omit END in ranges (START:END)
* decoder:
- ffmpeg: support float planar audio (ffmpeg 1.1)
- ffmpeg: fix AVFrame allocation
* player:
- implement missing "idle" events on output errors
* clock: fix build failure
...
...
src/decoder/ffmpeg_decoder_plugin.c
View file @
e0c2c77c
...
...
@@ -318,20 +318,33 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
cmd
==
DECODE_COMMAND_NONE
)
{
int
audio_size
=
buffer_size
;
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,25,0)
AVFrame
frame
;
AVFrame
*
frame
=
avcodec_alloc_frame
();
if
(
frame
==
NULL
)
{
g_warning
(
"Could not allocate frame"
);
break
;
}
int
got_frame
=
0
;
int
len
=
avcodec_decode_audio4
(
codec_context
,
&
frame
,
&
got_frame
,
frame
,
&
got_frame
,
&
packet2
);
if
(
len
>=
0
&&
got_frame
)
{
audio_size
=
copy_interleave_frame
(
codec_context
,
&
frame
,
frame
,
aligned_buffer
,
buffer_size
);
if
(
audio_size
<
0
)
len
=
audio_size
;
}
else
if
(
len
>=
0
)
len
=
-
1
;
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
avcodec_free_frame
(
&
frame
);
#else
av_freep
(
&
frame
);
#endif
#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,25,0)
int
len
=
avcodec_decode_audio3
(
codec_context
,
aligned_buffer
,
&
audio_size
,
...
...
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