mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
core: use STREAM_CTRL instead of accessing stream_dvd internals
Some code in mplayer.c did stuff like accessing (dvd_priv_t *)st->priv. Do this indirectly by introducing STREAM_CTRL_GET_DVD_INFO. This is extremely specific to DVD, so it's not worth abstracting this further. This is a preparation for turning the cache into an actual stream, which simply wraps the cached stream. There are other streams which are accessed in the way DVD was, at least TV/radio/DVB. We assume these can't be used with the cache. The code doesn't look thread-safe or fork aware.
This commit is contained in:
@@ -747,6 +747,14 @@ static int control(stream_t *stream,int cmd,void* arg)
|
||||
}
|
||||
case STREAM_CTRL_MANAGES_TIMELINE:
|
||||
return STREAM_OK;
|
||||
case STREAM_CTRL_GET_DVD_INFO:
|
||||
{
|
||||
struct stream_dvd_info_req *req = arg;
|
||||
memset(req, 0, sizeof(*req));
|
||||
req->num_subs = dvd_number_of_subs(stream);
|
||||
memcpy(req->palette, d->cur_pgc->palette, sizeof(req->palette));
|
||||
return STREAM_OK;
|
||||
}
|
||||
}
|
||||
return STREAM_UNSUPPORTED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user