Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
bcfcb8b8
Commit
bcfcb8b8
authored
Dec 29, 2013
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/ffwavesynth: fix dependency sizeof(AVFrame).
parent
d890db5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
ffwavesynth.c
libavcodec/ffwavesynth.c
+4
-7
No files found.
libavcodec/ffwavesynth.c
View file @
bcfcb8b8
...
@@ -93,7 +93,6 @@ struct wavesynth_context {
...
@@ -93,7 +93,6 @@ struct wavesynth_context {
int64_t
cur_ts
;
int64_t
cur_ts
;
int64_t
next_ts
;
int64_t
next_ts
;
int32_t
*
sin
;
int32_t
*
sin
;
AVFrame
frame
;
struct
ws_interval
*
inter
;
struct
ws_interval
*
inter
;
uint32_t
dither_state
;
uint32_t
dither_state
;
uint32_t
pink_state
;
uint32_t
pink_state
;
...
@@ -341,8 +340,6 @@ static av_cold int wavesynth_init(AVCodecContext *avc)
...
@@ -341,8 +340,6 @@ static av_cold int wavesynth_init(AVCodecContext *avc)
ws
->
pink_need
+=
ws
->
inter
[
i
].
type
==
WS_NOISE
;
ws
->
pink_need
+=
ws
->
inter
[
i
].
type
==
WS_NOISE
;
ws
->
pink_state
=
MKTAG
(
'P'
,
'I'
,
'N'
,
'K'
);
ws
->
pink_state
=
MKTAG
(
'P'
,
'I'
,
'N'
,
'K'
);
ws
->
pink_pos
=
PINK_UNIT
;
ws
->
pink_pos
=
PINK_UNIT
;
avcodec_get_frame_defaults
(
&
ws
->
frame
);
avc
->
coded_frame
=
&
ws
->
frame
;
wavesynth_seek
(
ws
,
0
);
wavesynth_seek
(
ws
,
0
);
avc
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
avc
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
return
0
;
return
0
;
...
@@ -428,6 +425,7 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
...
@@ -428,6 +425,7 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
AVPacket
*
packet
)
AVPacket
*
packet
)
{
{
struct
wavesynth_context
*
ws
=
avc
->
priv_data
;
struct
wavesynth_context
*
ws
=
avc
->
priv_data
;
AVFrame
*
frame
=
rframe
;
int64_t
ts
;
int64_t
ts
;
int
duration
;
int
duration
;
int
s
,
c
,
r
;
int
s
,
c
,
r
;
...
@@ -443,11 +441,11 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
...
@@ -443,11 +441,11 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
duration
=
AV_RL32
(
packet
->
data
+
8
);
duration
=
AV_RL32
(
packet
->
data
+
8
);
if
(
duration
<=
0
)
if
(
duration
<=
0
)
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
ws
->
frame
.
nb_samples
=
duration
;
frame
->
nb_samples
=
duration
;
r
=
ff_get_buffer
(
avc
,
&
ws
->
frame
,
0
);
r
=
ff_get_buffer
(
avc
,
frame
,
0
);
if
(
r
<
0
)
if
(
r
<
0
)
return
r
;
return
r
;
pcm
=
(
int16_t
*
)
ws
->
frame
.
data
[
0
];
pcm
=
(
int16_t
*
)
frame
->
data
[
0
];
for
(
s
=
0
;
s
<
duration
;
s
++
,
ts
++
)
{
for
(
s
=
0
;
s
<
duration
;
s
++
,
ts
++
)
{
memset
(
channels
,
0
,
avc
->
channels
*
sizeof
(
*
channels
));
memset
(
channels
,
0
,
avc
->
channels
*
sizeof
(
*
channels
));
if
(
ts
>=
ws
->
next_ts
)
if
(
ts
>=
ws
->
next_ts
)
...
@@ -458,7 +456,6 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
...
@@ -458,7 +456,6 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
}
}
ws
->
cur_ts
+=
duration
;
ws
->
cur_ts
+=
duration
;
*
rgot_frame
=
1
;
*
rgot_frame
=
1
;
*
(
AVFrame
*
)
rframe
=
ws
->
frame
;
return
packet
->
size
;
return
packet
->
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