aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffwavesynth.c
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2013-12-29 10:33:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-07 21:28:41 +0100
commit89205b637e23c27f43c15e3e60cab29e9bda5a38 (patch)
tree48417b1f8c4f069c7073a3744ab30b893069a6e3 /libavcodec/ffwavesynth.c
parent88058b4650f59876189648c2ca9e7c5ac3d68905 (diff)
downloadandroid_external_ffmpeg-89205b637e23c27f43c15e3e60cab29e9bda5a38.tar.gz
android_external_ffmpeg-89205b637e23c27f43c15e3e60cab29e9bda5a38.tar.bz2
android_external_ffmpeg-89205b637e23c27f43c15e3e60cab29e9bda5a38.zip
lavc/ffwavesynth: fix dependency sizeof(AVFrame).
(cherry picked from commit bcfcb8b8524dfcc1c37d520ccf3fba3b3a4c104d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffwavesynth.c')
-rw-r--r--libavcodec/ffwavesynth.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c
index a62746d61c..4a5031a8ca 100644
--- a/libavcodec/ffwavesynth.c
+++ b/libavcodec/ffwavesynth.c
@@ -93,7 +93,6 @@ struct wavesynth_context {
int64_t cur_ts;
int64_t next_ts;
int32_t *sin;
- AVFrame frame;
struct ws_interval *inter;
uint32_t dither_state;
uint32_t pink_state;
@@ -341,8 +340,6 @@ static av_cold int wavesynth_init(AVCodecContext *avc)
ws->pink_need += ws->inter[i].type == WS_NOISE;
ws->pink_state = MKTAG('P','I','N','K');
ws->pink_pos = PINK_UNIT;
- avcodec_get_frame_defaults(&ws->frame);
- avc->coded_frame = &ws->frame;
wavesynth_seek(ws, 0);
avc->sample_fmt = AV_SAMPLE_FMT_S16;
return 0;
@@ -428,6 +425,7 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
AVPacket *packet)
{
struct wavesynth_context *ws = avc->priv_data;
+ AVFrame *frame = rframe;
int64_t ts;
int duration;
int s, c, r;
@@ -443,11 +441,11 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
duration = AV_RL32(packet->data + 8);
if (duration <= 0)
return AVERROR(EINVAL);
- ws->frame.nb_samples = duration;
- r = ff_get_buffer(avc, &ws->frame, 0);
+ frame->nb_samples = duration;
+ r = ff_get_buffer(avc, frame, 0);
if (r < 0)
return r;
- pcm = (int16_t *)ws->frame.data[0];
+ pcm = (int16_t *)frame->data[0];
for (s = 0; s < duration; s++, ts++) {
memset(channels, 0, avc->channels * sizeof(*channels));
if (ts >= ws->next_ts)
@@ -458,7 +456,6 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
}
ws->cur_ts += duration;
*rgot_frame = 1;
- *(AVFrame *)rframe = ws->frame;
return packet->size;
}