1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

stream_file: initialize fd

Use the fd variable and delay assignment to priv->fd to mirror other
branches of the if/else tree.
This commit is contained in:
Ben Boeckel 2015-07-09 16:13:40 -04:00 committed by wm4
parent f3d06e3e91
commit 731fc5b816

View File

@ -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) {