summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvdnav.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-10 22:09:27 +0200
committerwm4 <wm4@nowhere>2014-06-11 00:39:06 +0200
commit35e6d1abe0315caee3f21ca3853d76423baa0c91 (patch)
treee17f0f7f035cf8c5ee3cd5aab741bddc1a134b36 /stream/stream_dvdnav.c
parent959b718957527710b4bcf6e7227a0beaeb034137 (diff)
downloadmpv-35e6d1abe0315caee3f21ca3853d76423baa0c91.tar.bz2
mpv-35e6d1abe0315caee3f21ca3853d76423baa0c91.tar.xz
stream_dvd, stream_dvdnav, stream_bluray: remove global option variables
Diffstat (limited to 'stream/stream_dvdnav.c')
-rw-r--r--stream/stream_dvdnav.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index b438e7205c..20382a14e4 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -57,6 +57,8 @@ struct priv {
bool nav_enabled;
bool had_initial_vts;
+ int dvd_speed;
+
int track;
char *device;
};
@@ -630,7 +632,8 @@ static void stream_dvdnav_close(stream_t *s)
struct priv *priv = s->priv;
dvdnav_close(priv->dvdnav);
priv->dvdnav = NULL;
- dvd_set_speed(s, priv->filename, -1);
+ if (priv->dvd_speed)
+ dvd_set_speed(s, priv->filename, -1);
}
static struct priv *new_dvdnav_stream(stream_t *stream, char *filename)
@@ -644,7 +647,8 @@ static struct priv *new_dvdnav_stream(stream_t *stream, char *filename)
if (!(priv->filename = strdup(filename)))
return NULL;
- dvd_set_speed(stream, priv->filename, dvd_speed);
+ priv->dvd_speed = stream->opts->dvd_speed;
+ dvd_set_speed(stream, priv->filename, priv->dvd_speed);
if (dvdnav_open(&(priv->dvdnav), priv->filename) != DVDNAV_STATUS_OK) {
free(priv->filename);
@@ -670,10 +674,10 @@ static int open_s(stream_t *stream)
priv = p = stream->priv;
char *filename;
- if (p->device)
+ if (p->device && p->device[0])
filename = p->device;
- else if (dvd_device)
- filename = dvd_device;
+ else if (stream->opts->dvd_device && stream->opts->dvd_device[0])
+ filename = stream->opts->dvd_device;
else
filename = DEFAULT_DVD_DEVICE;
if (!new_dvdnav_stream(stream, filename)) {
@@ -715,8 +719,8 @@ static int open_s(stream_t *stream)
if (dvdnav_menu_call(priv->dvdnav, DVD_MENU_Root) != DVDNAV_STATUS_OK)
dvdnav_menu_call(priv->dvdnav, DVD_MENU_Title);
}
- if (dvd_angle > 1)
- dvdnav_angle_change(priv->dvdnav, dvd_angle);
+ if (stream->opts->dvd_angle > 1)
+ dvdnav_angle_change(priv->dvdnav, stream->opts->dvd_angle);
stream->sector_size = 2048;
stream->fill_buffer = fill_buffer;