Skip to content

Commit

Permalink
Change codec->reset() to codec->drop().
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc0 committed May 22, 2015
1 parent 6b1545f commit 77ff05f
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions alsa.c
Expand Up @@ -84,7 +84,7 @@ ssize_t alsa_delay(struct codec *c)
return state->delay;
}

void alsa_reset(struct codec *c)
void alsa_drop(struct codec *c)
{
struct alsa_state *state = (struct alsa_state *) c->data;
snd_pcm_reset(state->dev);
Expand Down Expand Up @@ -214,7 +214,7 @@ struct codec * alsa_codec_init(const char *path, const char *type, const char *e
c->write = alsa_write;
c->seek = alsa_seek;
c->delay = alsa_delay;
c->reset = alsa_reset;
c->drop = alsa_drop;
c->pause = alsa_pause;
c->destroy = alsa_destroy;
c->data = state;
Expand Down
4 changes: 2 additions & 2 deletions ao.c
Expand Up @@ -70,7 +70,7 @@ ssize_t ao_delay(struct codec *c)
return 0;
}

void ao_reset(struct codec *c)
void ao_drop(struct codec *c)
{
/* do nothing */
}
Expand Down Expand Up @@ -141,7 +141,7 @@ struct codec * ao_codec_init(const char *path, const char *type, const char *enc
c->write = ao_write;
c->seek = ao_seek;
c->delay = ao_delay;
c->reset = ao_reset;
c->drop = ao_drop;
c->pause = ao_pause;
c->destroy = ao_destroy;
c->data = state;
Expand Down
2 changes: 1 addition & 1 deletion codec.h
Expand Up @@ -24,7 +24,7 @@ struct codec {
ssize_t (*write)(struct codec *, sample_t *, ssize_t);
ssize_t (*seek)(struct codec *, ssize_t);
ssize_t (*delay)(struct codec *);
void (*reset)(struct codec *); /* drop pending frames */
void (*drop)(struct codec *); /* drop pending frames */
void (*pause)(struct codec *, int);
void (*destroy)(struct codec *);
void *data;
Expand Down
8 changes: 4 additions & 4 deletions dsp.c
Expand Up @@ -277,7 +277,7 @@ static void terminate(int s)
{
LOG(LL_NORMAL, "\ndsp: info: signal %d: terminating...\n", s);
if (out_codec != NULL)
out_codec->reset(out_codec); /* reset so we don't sit around waiting for alsa to drain */
out_codec->drop(out_codec);
cleanup_and_exit(0);
}

Expand Down Expand Up @@ -323,7 +323,7 @@ static ssize_t do_seek(struct codec *in, struct codec *out, ssize_t pos, ssize_t
else
s = pos + offset - delay;
if ((s = in->seek(in, s)) >= 0) {
out->reset(out);
out->drop(out);
reset_effects_chain(&chain);
return s;
}
Expand Down Expand Up @@ -475,7 +475,7 @@ int main(int argc, char *argv[])
pos = do_seek(in_codecs.head, out_codec, pos, delay, 0, SEEK_SET);
break;
case 'n':
out_codec->reset(out_codec);
out_codec->drop(out_codec);
reset_effects_chain(&chain);
goto next_input;
case 'c':
Expand Down Expand Up @@ -527,7 +527,7 @@ int main(int argc, char *argv[])
verbose_progress = (verbose_progress) ? 0 : 1;
break;
case 'q':
out_codec->reset(out_codec);
out_codec->drop(out_codec);
if (show_progress)
fputs("\033[1K\r", stderr);
goto end_rw_loop;
Expand Down
4 changes: 2 additions & 2 deletions ffmpeg.c
Expand Up @@ -160,7 +160,7 @@ ssize_t ffmpeg_delay(struct codec *c)
return 0;
}

void ffmpeg_reset(struct codec *c)
void ffmpeg_drop(struct codec *c)
{
/* do nothing */
}
Expand Down Expand Up @@ -281,7 +281,7 @@ struct codec * ffmpeg_codec_init(const char *path, const char *type, const char
c->write = ffmpeg_write;
c->seek = ffmpeg_seek;
c->delay = ffmpeg_delay;
c->reset = ffmpeg_reset;
c->drop = ffmpeg_drop;
c->pause = ffmpeg_pause;
c->destroy = ffmpeg_destroy;
c->data = state;
Expand Down
4 changes: 2 additions & 2 deletions mp3.c
Expand Up @@ -123,7 +123,7 @@ ssize_t mp3_delay(struct codec *c)
return 0;
}

void mp3_reset(struct codec *c)
void mp3_drop(struct codec *c)
{
/* do nothing */
}
Expand Down Expand Up @@ -235,7 +235,7 @@ struct codec * mp3_codec_init(const char *path, const char *type, const char *en
c->write = mp3_write;
c->seek = mp3_seek;
c->delay = mp3_delay;
c->reset = mp3_reset;
c->drop = mp3_drop;
c->pause = mp3_pause;
c->destroy = mp3_destroy;
c->data = state;
Expand Down
4 changes: 2 additions & 2 deletions null.c
Expand Up @@ -24,7 +24,7 @@ ssize_t null_delay(struct codec *c)
return 0;
}

void null_reset(struct codec *c)
void null_drop(struct codec *c)
{
/* do nothing */
}
Expand Down Expand Up @@ -53,7 +53,7 @@ struct codec * null_codec_init(const char *path, const char *type, const char *e
c->write = null_write;
c->seek = null_seek;
c->delay = null_delay;
c->reset = null_reset;
c->drop = null_drop;
c->pause = null_pause;
c->destroy = null_destroy;
c->data = NULL;
Expand Down
4 changes: 2 additions & 2 deletions pcm.c
Expand Up @@ -104,7 +104,7 @@ ssize_t pcm_delay(struct codec *c)
return 0;
}

void pcm_reset(struct codec *c)
void pcm_drop(struct codec *c)
{
/* do nothing */
}
Expand Down Expand Up @@ -170,7 +170,7 @@ struct codec * pcm_codec_init(const char *path, const char *type, const char *en
c->write = pcm_write;
c->seek = pcm_seek;
c->delay = pcm_delay;
c->reset = pcm_reset;
c->drop = pcm_drop;
c->pause = pcm_pause;
c->destroy = pcm_destroy;
c->data = state;
Expand Down
4 changes: 2 additions & 2 deletions pulse.c
Expand Up @@ -63,7 +63,7 @@ ssize_t pulse_delay(struct codec *c)
return pa_simple_get_latency(state->s, NULL) * c->fs / 1000000;
}

void pulse_reset(struct codec *c)
void pulse_drop(struct codec *c)
{
struct pulse_state *state = (struct pulse_state *) c->data;
pa_simple_flush(state->s, NULL);
Expand Down Expand Up @@ -147,7 +147,7 @@ struct codec * pulse_codec_init(const char *path, const char *type, const char *
c->write = pulse_write;
c->seek = pulse_seek;
c->delay = pulse_delay;
c->reset = pulse_reset;
c->drop = pulse_drop;
c->pause = pulse_pause;
c->destroy = pulse_destroy;
c->data = state;
Expand Down
4 changes: 2 additions & 2 deletions sndfile.c
Expand Up @@ -101,7 +101,7 @@ ssize_t sndfile_delay(struct codec *c)
return 0;
}

void sndfile_reset(struct codec *c)
void sndfile_drop(struct codec *c)
{
/* do nothing */
}
Expand Down Expand Up @@ -220,7 +220,7 @@ struct codec * sndfile_codec_init(const char *path, const char *type, const char
c->write = sndfile_write;
c->seek = sndfile_seek;
c->delay = sndfile_delay;
c->reset = sndfile_reset;
c->drop = sndfile_drop;
c->pause = sndfile_pause;
c->destroy = sndfile_destroy;
c->data = state;
Expand Down

0 comments on commit 77ff05f

Please sign in to comment.