diff --git a/README.md b/README.md index 63c2f49..18d7f83 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,8 @@ The table below is a simple documentation of the URL query keys and values used | `flags` | `--vo%3Dgpu` | Custom command options and flags to be passed to the video player | ### Playlist and `enqueue` functionality -For `enqueue` to work properly with any mpv-based player, the playes has to be able to read commands from a `fifo` name pipe. This can be achieved by adding the following lines to any of the user's startup utilities/files, e.g. `.bashrc`, `.zshrc` or `.profile`. +For `enqueue` to work properly with any mpv-based player, the playes has to be able to read commands from a `fifo` name pipe. This can be achieved by adding the following line to the video player's configuration (usually `.conf/mpv/mpv.conf` for mpv). -```sh -mpvsocket=/tmp/mpvsocket -[[ ! -p /tmp/mpvsocket ]] && mkfifo /tmp/mpvsocket +``` +input-ipc-server=/tmp/mpvsocket ``` \ No newline at end of file diff --git a/src/mpvipc.hpp b/src/mpvipc.hpp index 26c0684..137a447 100644 --- a/src/mpvipc.hpp +++ b/src/mpvipc.hpp @@ -1,5 +1,5 @@ -#ifndef MPVIPC_H_ -#define MPVIPC_H_ +#ifndef MPVIPC_HPP_ +#define MPVIPC_HPP_ #include #include diff --git a/src/mpvopts.hpp b/src/mpvopts.hpp index b5bdab7..2e44d70 100644 --- a/src/mpvopts.hpp +++ b/src/mpvopts.hpp @@ -1,5 +1,5 @@ -#ifndef MPVOPTS_H_ -#define MPVOPTS_H_ +#ifndef MPVOPTS_HPP_ +#define MPVOPTS_HPP_ #include #include @@ -146,7 +146,7 @@ string url_decode(const string encoded) { */ string query_value(string query, string key) { // Find the beginning of the last occurrence of `key` in `query` - auto pos = query.rfind(key); + auto pos = query.rfind(key + "="); if (pos == string::npos) return ""; // Offset calculation (beginning of the value string associated with `key`): @@ -159,5 +159,4 @@ string query_value(string query, string key) { return query.substr(offset, query.find('&', pos) - offset); } - #endif \ No newline at end of file