summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvdnav.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-23 18:07:13 +0100
committerwm4 <wm4@nowhere>2014-02-23 18:16:33 +0100
commit42e70868ab24b16189924a26efd5bfdc0b960e8a (patch)
tree27fbc7937e3ffdf316317dcf54475c58637bb284 /stream/stream_dvdnav.c
parent5cbef87c17ce4944893b53796370a1ffeb7a24f0 (diff)
downloadmpv-42e70868ab24b16189924a26efd5bfdc0b960e8a.tar.bz2
mpv-42e70868ab24b16189924a26efd5bfdc0b960e8a.tar.xz
dvd: check for empty DVD volume ID
The only DVD sample I have just returns an empty string for this. Let command.c use the filename if the ID is empty.
Diffstat (limited to 'stream/stream_dvdnav.c')
-rw-r--r--stream/stream_dvdnav.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index 537047fe04..887b112d70 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -604,7 +604,9 @@ static int control(stream_t *stream, int cmd, void *arg)
}
case STREAM_CTRL_GET_DVD_VOLUME_ID: {
const char *volume = NULL;
- if (dvdnav_get_title_string(dvdnav, &volume) != DVDNAV_STATUS_OK || !volume)
+ if (dvdnav_get_title_string(dvdnav, &volume) != DVDNAV_STATUS_OK)
+ return STREAM_ERROR;
+ if (!volume || !volume[0])
return STREAM_ERROR;
*(char**)arg = talloc_strdup(NULL, volume);
return STREAM_OK;