From 3bbb98318df2fc3d1a61cecd2b06d1bec9964651 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 14 Mar 2025 09:39:44 +0000 Subject: [PATCH] advertise the correct MediaType when transcoding some TVs fail if you send a Content-Type of the source file (matroska) follow by a transcoded body (mpeg ts) --- cmd/go2tv-lite/go2tv.go | 4 ++++ cmd/go2tv/go2tv.go | 4 ++++ internal/gui/actions.go | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/cmd/go2tv-lite/go2tv.go b/cmd/go2tv-lite/go2tv.go index 5513e29..d002311 100644 --- a/cmd/go2tv-lite/go2tv.go +++ b/cmd/go2tv-lite/go2tv.go @@ -137,6 +137,10 @@ func run() error { absMediaFile = *urlArg } + if *transcodePtr && strings.Contains(mediaType, "video") { + mediaType = "video/vnd.dlna.mpeg-tts" + } + absSubtitlesFile, err := filepath.Abs(*subsArg) if err != nil { return err diff --git a/cmd/go2tv/go2tv.go b/cmd/go2tv/go2tv.go index 21bd6cd..b5c4e92 100644 --- a/cmd/go2tv/go2tv.go +++ b/cmd/go2tv/go2tv.go @@ -136,6 +136,10 @@ func run() error { absMediaFile = *urlArg } + if *transcodePtr && strings.Contains(mediaType, "video") { + mediaType = "video/vnd.dlna.mpeg-tts" + } + absSubtitlesFile, err := filepath.Abs(*subsArg) if err != nil { return err diff --git a/internal/gui/actions.go b/internal/gui/actions.go index 3049c6f..db9b7f5 100644 --- a/internal/gui/actions.go +++ b/internal/gui/actions.go @@ -339,6 +339,10 @@ func playAction(screen *FyneScreen) { } } + if screen.Transcode && strings.Contains(mediaType, "video") { + mediaType = "video/vnd.dlna.mpeg-tts" + } + if screen.SelectInternalSubs.Selected != "" { for n, opt := range screen.SelectInternalSubs.Options { if opt == screen.SelectInternalSubs.Selected {