diff options
author | wm4 <wm4@nowhere> | 2019-11-07 15:54:34 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-07 22:53:13 +0100 |
commit | e5a9b792ecf08ddbcf3b674de3a00f7a919d1858 (patch) | |
tree | ead751b12d006d13f138867324b62dda62b8e77b /stream/stream_cdda.c | |
parent | ca75fedaf4dea19986159f1caa5ab9ebc202f9d4 (diff) | |
download | mpv-e5a9b792ecf08ddbcf3b674de3a00f7a919d1858.tar.bz2 mpv-e5a9b792ecf08ddbcf3b674de3a00f7a919d1858.tar.xz |
stream: replace STREAM_CTRL_GET_SIZE with a proper entrypoint
This is overlay convoluted as a stream control, and important enough to
warrant "first class" functionality.
Diffstat (limited to 'stream/stream_cdda.c')
-rw-r--r-- | stream/stream_cdda.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c index cc1c7646a3..158cfd0646 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -262,14 +262,16 @@ 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; } +static int64_t get_size(stream_t *st) +{ + cdda_priv *p = st->priv; + return (p->end_sector + 1 - p->start_sector) * CDIO_CD_FRAMESIZE_RAW; +} + static int open_cdda(stream_t *st) { st->priv = mp_get_config_group(st, st->global, &stream_cdda_conf); @@ -383,6 +385,7 @@ static int open_cdda(stream_t *st) st->seek = seek; st->seekable = true; st->control = control; + st->get_size = get_size; st->close = close_cdda; st->streaming = true; |