summaryrefslogtreecommitdiffstats
path: root/stream/stream_cdda.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-06 21:32:44 +0100
committerwm4 <wm4@nowhere>2015-02-06 21:43:52 +0100
commit5de29b860b25bb4ba8b1e02d9b3aee7a81009be0 (patch)
tree48e2b98f35ceb2aecef8a0706e921e3219b6994d /stream/stream_cdda.c
parent347cf972310c0de5565015190c1cd6e7d3d3d30c (diff)
downloadmpv-5de29b860b25bb4ba8b1e02d9b3aee7a81009be0.tar.bz2
mpv-5de29b860b25bb4ba8b1e02d9b3aee7a81009be0.tar.xz
stream: get rid of remaining uses of the end_pos field
Most things stopped using this field for better support of growing files. Go through the trouble to repalce the remaining uses, so it can be removed. Also move the "streaming" field; saves 4 bytes (wow!).
Diffstat (limited to 'stream/stream_cdda.c')
-rw-r--r--stream/stream_cdda.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index a75ee3ae40..13ec14644b 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -266,6 +266,10 @@ static int control(stream_t *stream, int cmd, void *arg)
*(double *)arg = pos / (44100.0 * 2 * 2);
return STREAM_OK;
}
+ case STREAM_CTRL_GET_SIZE:
+ *(int64_t *)arg =
+ (p->end_sector + 1 - p->start_sector) * CDIO_CD_FRAMESIZE_RAW;
+ return STREAM_OK;
}
return STREAM_UNSUPPORTED;
}
@@ -373,8 +377,6 @@ static int open_cdda(stream_t *st)
priv->sector = priv->start_sector;
st->priv = priv;
- st->end_pos =
- (priv->end_sector + 1 - priv->start_sector) * CDIO_CD_FRAMESIZE_RAW;
st->sector_size = CDIO_CD_FRAMESIZE_RAW;
st->fill_buffer = fill_buffer;