From 2264f33d29a45f231f30d91d3776d4ff0e3a9429 Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Tue, 30 Dec 2025 20:03:47 +0530 Subject: [PATCH] fix: remote id not needed --- cmd/client/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/client/main.go b/cmd/client/main.go index 97715ba..8f5c782 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -24,7 +24,7 @@ func main() { log.Printf("creating socket at %s", socketPath) - cmd := exec.Command("mpv", videoStream, fmt.Sprintf("--input-ipc-server=%s", socketPath), "--force-window=immediate") + cmd := exec.Command("mpv", videoStream, fmt.Sprintf("--input-ipc-server=%s", socketPath), "--force-window=immediate", "--pause") log.Print(cmd) done := make(chan error) @@ -77,7 +77,7 @@ type ConnCouple struct { func handleMpv(couple *ConnCouple) { const observePause = "{ \"command\": [\"observe_property\", 1, \"pause\"] }\n" - const getTime = "{ \"command\": [\"get_property\", \"time-pos\"], request_id: %d }\n" + const getTime = "{ \"command\": [\"get_property\", \"time-pos\"] }\n" couple.mpv.Write([]byte(observePause)) mpvReader := bufio.NewReader(couple.mpv) @@ -119,7 +119,7 @@ func handleMpv(couple *ConnCouple) { } } else if eventExists && event == "seek" { - couple.mpv.Write([]byte(fmt.Sprintf(getTime, 0))) + couple.mpv.Write([]byte(getTime)) } else if error, exists := blob["error"]; exists { if error != "success" { log.Print("seek time request failed: %s", error) @@ -166,7 +166,7 @@ func handleNet(couple *ConnCouple) { log.Printf("net: %s", message) time, err := strconv.ParseFloat(messageStr, 64) if err == nil { - command := fmt.Sprintf("{ \"command\": [\"seek\", %f, \"absolute\"], \"request_id\": %d }\n", time, 0) + command := fmt.Sprintf("{ \"command\": [\"seek\", %f, \"absolute\"] }\n", time) couple.mpv.Write([]byte(command)) couple.hasSeeked = true // couple.id += 1 @@ -175,7 +175,7 @@ func handleNet(couple *ConnCouple) { pause, err := strconv.ParseBool(messageStr) if err == nil { - command := fmt.Sprintf("{ \"command\": [\"set_property\", \"pause\", %t], \"request_id\": %d }\n", pause, 0) + command := fmt.Sprintf("{ \"command\": [\"set_property\", \"pause\", %t] }\n", pause) couple.mpv.Write([]byte(command)) couple.hasPaused = true // couple.id += 1