Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
08ec828d
Commit
08ec828d
authored
7 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
avcodec/vorbisenc: Fix mixed declaration and statements
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
d76838c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/vorbisenc.c
+4
-2
4 additions, 2 deletions
libavcodec/vorbisenc.c
with
4 additions
and
2 deletions
libavcodec/vorbisenc.c
+
4
−
2
View file @
08ec828d
...
@@ -1026,6 +1026,7 @@ static int apply_window_and_mdct(vorbis_enc_context *venc)
...
@@ -1026,6 +1026,7 @@ static int apply_window_and_mdct(vorbis_enc_context *venc)
static
AVFrame
*
spawn_empty_frame
(
AVCodecContext
*
avctx
,
int
channels
)
static
AVFrame
*
spawn_empty_frame
(
AVCodecContext
*
avctx
,
int
channels
)
{
{
AVFrame
*
f
=
av_frame_alloc
();
AVFrame
*
f
=
av_frame_alloc
();
int
ch
;
if
(
!
f
)
if
(
!
f
)
return
NULL
;
return
NULL
;
...
@@ -1039,7 +1040,7 @@ static AVFrame *spawn_empty_frame(AVCodecContext *avctx, int channels)
...
@@ -1039,7 +1040,7 @@ static AVFrame *spawn_empty_frame(AVCodecContext *avctx, int channels)
return
NULL
;
return
NULL
;
}
}
for
(
int
ch
=
0
;
ch
<
channels
;
ch
++
)
{
for
(
ch
=
0
;
ch
<
channels
;
ch
++
)
{
size_t
bps
=
av_get_bytes_per_sample
(
f
->
format
);
size_t
bps
=
av_get_bytes_per_sample
(
f
->
format
);
memset
(
f
->
extended_data
[
ch
],
0
,
bps
*
f
->
nb_samples
);
memset
(
f
->
extended_data
[
ch
],
0
,
bps
*
f
->
nb_samples
);
}
}
...
@@ -1108,8 +1109,9 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
...
@@ -1108,8 +1109,9 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if
(
!
frame
)
{
if
(
!
frame
)
{
if
(
venc
->
bufqueue
.
available
*
avctx
->
frame_size
<
frame_size
)
{
if
(
venc
->
bufqueue
.
available
*
avctx
->
frame_size
<
frame_size
)
{
int
frames_needed
=
(
frame_size
/
avctx
->
frame_size
)
-
venc
->
bufqueue
.
available
;
int
frames_needed
=
(
frame_size
/
avctx
->
frame_size
)
-
venc
->
bufqueue
.
available
;
int
i
;
for
(
int
i
=
0
;
i
<
frames_needed
;
i
++
)
{
for
(
i
=
0
;
i
<
frames_needed
;
i
++
)
{
AVFrame
*
empty
=
spawn_empty_frame
(
avctx
,
venc
->
channels
);
AVFrame
*
empty
=
spawn_empty_frame
(
avctx
,
venc
->
channels
);
if
(
!
empty
)
if
(
!
empty
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment