diff options
author | wm4 <wm4@nowhere> | 2014-02-23 18:07:13 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-23 18:16:33 +0100 |
commit | 42e70868ab24b16189924a26efd5bfdc0b960e8a (patch) | |
tree | 27fbc7937e3ffdf316317dcf54475c58637bb284 /stream/stream_dvd.c | |
parent | 5cbef87c17ce4944893b53796370a1ffeb7a24f0 (diff) | |
download | mpv-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_dvd.c')
-rw-r--r-- | stream/stream_dvd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 7e3c9c1cc3..3dc7e76cc3 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -730,8 +730,10 @@ static int control(stream_t *stream,int cmd,void* arg) case STREAM_CTRL_GET_DVD_VOLUME_ID: { char buffer[128]; - if (DVDUDFVolumeInfo(d->dvd, buffer, sizeof(buffer), NULL, 0) < 0 - && DVDISOVolumeInfo(d->dvd, buffer, sizeof(buffer), NULL, 0) < 0) + if (DVDUDFVolumeInfo(d->dvd, buffer, sizeof(buffer), NULL, 0) < 0 && + DVDISOVolumeInfo(d->dvd, buffer, sizeof(buffer), NULL, 0) < 0) + return STREAM_ERROR; + if (!buffer[0]) return STREAM_ERROR; *(char**)arg = talloc_strdup(NULL, buffer); return STREAM_OK; |