summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2015-07-09 16:13:40 -0400
committerwm4 <wm4@nowhere>2015-07-09 23:04:06 +0200
commit731fc5b816fad91607728a2bfd1db6bb0317d511 (patch)
treebe4ec5590da26a310966328197c76f76d263e363 /stream
parentf3d06e3e913ea061a716935a561c9d5c1758f718 (diff)
downloadmpv-731fc5b816fad91607728a2bfd1db6bb0317d511.tar.bz2
mpv-731fc5b816fad91607728a2bfd1db6bb0317d511.tar.xz
stream_file: initialize `fd`
Use the fd variable and delay assignment to priv->fd to mirror other branches of the if/else tree.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c
index bfc50df5de..54a848e4c8 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -249,11 +249,12 @@ static int open_f(stream_t *stream)
if (strncmp(stream->url, "fd://", 5) == 0) {
char *end = NULL;
- priv->fd = strtol(stream->url + 5, &end, 0);
+ fd = strtol(stream->url + 5, &end, 0);
if (!end || end == stream->url + 5 || end[0]) {
MP_ERR(stream, "Invalid FD: %s\n", stream->url);
return STREAM_ERROR;
}
+ priv->fd = fd;
priv->close = false;
} else if (!strcmp(filename, "-")) {
if (!write) {