Discussion:
[PATCH 1/4] nomad: remove unused code
Johannes Weißl
2011-04-12 15:23:05 UTC
Permalink
---
nomad.c | 48 ------------------------------------------------
nomad.h | 2 --
2 files changed, 0 insertions(+), 50 deletions(-)

diff --git a/nomad.c b/nomad.c
index 4345f1c..593e7d1 100644
--- a/nomad.c
+++ b/nomad.c
@@ -99,31 +99,6 @@ struct nomad {
struct nomad_callbacks cbs;
};

-/* ------------------------------------------------------------------------- */
-
-static ssize_t default_read(void *datasource, void *buffer, size_t count)
-{
- int fd = *(int *)datasource;
-
- return read(fd, buffer, count);
-}
-
-static off_t default_lseek(void *datasource, off_t offset, int whence)
-{
- int fd = *(int *)datasource;
-
- return lseek(fd, offset, whence);
-}
-
-static int default_close(void *datasource)
-{
- int fd = *(int *)datasource;
-
- return close(fd);
-}
-
-/* ------------------------------------------------------------------------- */
-
static inline int scale(mad_fixed_t sample)
{
sample += 1L << (MAD_F_FRACBITS - 16);
@@ -645,24 +620,6 @@ eof:
return -NOMAD_ERROR_FILE_FORMAT;
}

-int nomad_open(struct nomad **nomadp, int fd, int fast)
-{
- struct nomad *nomad;
-
- nomad = xnew0(struct nomad, 1);
- nomad->datasource = &nomad->datasource_fd;
- nomad->datasource_fd = fd;
- nomad->cbs.read = default_read;
- nomad->cbs.lseek = default_lseek;
- nomad->cbs.close = default_close;
- nomad->start_drop_samples = 0;
- nomad->end_drop_samples = 0;
- nomad->lame.peak = nomad->lame.trackGain = nomad->lame.albumGain = strtof("NAN", NULL);
- *nomadp = nomad;
- /* on error do_open calls nomad_close */
- return do_open(nomad, fast);
-}
-
int nomad_open_callbacks(struct nomad **nomadp, void *datasource, int fast, struct nomad_callbacks *cbs)
{
struct nomad *nomad;
@@ -917,11 +874,6 @@ int nomad_lame_replaygain(struct nomad *nomad, float *peak, float *trackGain)
return 0;
}

-double nomad_time_tell(struct nomad *nomad)
-{
- return timer_to_seconds(nomad->timer);
-}
-
double nomad_time_total(struct nomad *nomad)
{
return nomad->info.duration;
diff --git a/nomad.h b/nomad.h
index 36da057..4a01c81 100644
--- a/nomad.h
+++ b/nomad.h
@@ -64,7 +64,6 @@ enum {
struct nomad;

/* -NOMAD_ERROR_ERRNO -NOMAD_ERROR_FILE_FORMAT */
-int nomad_open(struct nomad **nomadp, int fd, int fast);
int nomad_open_callbacks(struct nomad **nomadp, void *datasource, int fast,
struct nomad_callbacks *cbs);

@@ -78,7 +77,6 @@ int nomad_read(struct nomad *nomad, char *buffer, int count);
int nomad_time_seek(struct nomad *nomad, double pos);

int nomad_lame_replaygain(struct nomad *nomad, float *peak, float *trackGain);
-double nomad_time_tell(struct nomad *nomad);
double nomad_time_total(struct nomad *nomad);
int nomad_bitrate(struct nomad *nomad);
int nomad_layer(struct nomad *nomad);
--
1.7.4.1
Loading...