mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
wip
This commit is contained in:
@@ -73,12 +73,6 @@ export const ItemContent: React.FC<ItemContentProps> = React.memo(
|
||||
defaultSubtitleIndex,
|
||||
} = useDefaultPlaySettings(item, settings);
|
||||
|
||||
console.log("defaultMediaSource", {
|
||||
defaultAudioIndex,
|
||||
defaultBitrate,
|
||||
defaultSubtitleIndex,
|
||||
});
|
||||
|
||||
const logoUrl = useMemo(
|
||||
() => (item ? getLogoImageUrlById({ api, item }) : null),
|
||||
[api, item],
|
||||
|
||||
@@ -104,11 +104,6 @@ export const MediaSourceButton: React.FC<Props> = ({
|
||||
|
||||
// Audio track group
|
||||
if (audioStreams.length > 0) {
|
||||
console.log("Audio comparison:", {
|
||||
selectedAudioIndex: selectedOptions.audioIndex,
|
||||
streamIndices: audioStreams.map((s) => s.Index),
|
||||
});
|
||||
|
||||
groups.push({
|
||||
title: t("item_card.audio"),
|
||||
options: audioStreams.map((stream) => ({
|
||||
|
||||
@@ -280,7 +280,6 @@ export const PlayButton: React.FC<Props> = ({
|
||||
]);
|
||||
|
||||
const onPress = useCallback(async () => {
|
||||
console.log("onPress");
|
||||
if (!item) return;
|
||||
|
||||
lightHapticFeedback();
|
||||
|
||||
@@ -59,7 +59,6 @@ export const PlayButton: React.FC<Props> = ({
|
||||
);
|
||||
|
||||
const onPress = () => {
|
||||
console.log("onpress");
|
||||
if (!item) return;
|
||||
|
||||
lightHapticFeedback();
|
||||
|
||||
@@ -12,12 +12,6 @@ const useDefaultPlaySettings = (item: BaseItemDto, settings: Settings | null) =>
|
||||
const { mediaSource, audioIndex, subtitleIndex, bitrate } =
|
||||
getDefaultPlaySettings(item, settings);
|
||||
|
||||
console.log("defaultPlaySettings", {
|
||||
audioIndex,
|
||||
subtitleIndex,
|
||||
bitrate,
|
||||
});
|
||||
|
||||
return {
|
||||
defaultMediaSource: mediaSource,
|
||||
defaultAudioIndex: audioIndex,
|
||||
|
||||
@@ -96,8 +96,6 @@ export const useWebSocket = ({
|
||||
| Record<string, string>
|
||||
| undefined; // Arguments are Dictionary<string, string>
|
||||
|
||||
console.log("[WS] ~ ", lastMessage);
|
||||
|
||||
if (command === "PlayPause") {
|
||||
console.log("Command ~ PlayPause");
|
||||
togglePlay();
|
||||
|
||||
@@ -94,7 +94,6 @@ final class IOSurfaceBufferPool {
|
||||
}
|
||||
}
|
||||
|
||||
Logger.shared.log("IOSurfaceBufferPool configured: \(width)x\(height), \(buffers.count) buffers", type: "Info")
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -122,7 +121,6 @@ final class IOSurfaceBufferPool {
|
||||
lock.lock()
|
||||
defer { lock.unlock() }
|
||||
|
||||
// Only return to available pool if it's one of our managed buffers
|
||||
if buffers.contains(where: { $0.pixelBuffer == buffer.pixelBuffer }) {
|
||||
availableBuffers.append(buffer)
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ final class MPVMetalRenderer {
|
||||
self.device = device
|
||||
self.commandQueue = device.makeCommandQueue()
|
||||
self.displayLayer = displayLayer
|
||||
self.bufferPool = IOSurfaceBufferPool(device: device, maxBufferCount: 3)
|
||||
self.bufferPool = IOSurfaceBufferPool(device: device, maxBufferCount: 6)
|
||||
|
||||
guard let screen = UIApplication.shared.connectedScenes
|
||||
.compactMap({ ($0 as? UIWindowScene)?.screen })
|
||||
@@ -147,10 +147,18 @@ final class MPVMetalRenderer {
|
||||
// Performance options
|
||||
setOption(name: "demuxer-thread", value: "yes")
|
||||
setOption(name: "profile", value: "fast")
|
||||
setOption(name: "vd-lavc-threads", value: "0") // Auto-detect
|
||||
setOption(name: "vd-lavc-threads", value: "0")
|
||||
setOption(name: "cache", value: "yes")
|
||||
setOption(name: "demuxer-max-bytes", value: "150M")
|
||||
setOption(name: "demuxer-readahead-secs", value: "20")
|
||||
setOption(name: "demuxer-max-bytes", value: "50M")
|
||||
setOption(name: "demuxer-readahead-secs", value: "10")
|
||||
|
||||
// A/V sync options - prioritize audio sync and allow frame drops
|
||||
setOption(name: "video-sync", value: "audio")
|
||||
setOption(name: "framedrop", value: "vo")
|
||||
setOption(name: "video-latency-hacks", value: "yes")
|
||||
|
||||
// Audio buffer to prevent underruns during heavy video load
|
||||
setOption(name: "audio-buffer", value: "0.2")
|
||||
|
||||
// Subtitle options - burn into video frames
|
||||
setOption(name: "vf", value: "sub")
|
||||
@@ -218,6 +226,7 @@ final class MPVMetalRenderer {
|
||||
} else {
|
||||
self.displayLayer.flushAndRemoveImage()
|
||||
}
|
||||
self.displayLayer.controlTimebase = nil
|
||||
}
|
||||
|
||||
isStopping = false
|
||||
@@ -622,9 +631,8 @@ final class MPVMetalRenderer {
|
||||
self.displayLayer.enqueue(sampleBuffer)
|
||||
}
|
||||
|
||||
// Return buffer to pool after a short delay to ensure it's been displayed
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { [weak self] in
|
||||
self?.bufferPool?.enqueueBuffer(buffer)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.032) { [weak self, weak bufferPool] in
|
||||
bufferPool?.enqueueBuffer(buffer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +269,7 @@ class MpvPlayerView: ExpoView {
|
||||
deinit {
|
||||
pipController?.stopPictureInPicture()
|
||||
renderer?.stop()
|
||||
displayLayer.controlTimebase = nil
|
||||
displayLayer.removeFromSuperlayer()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,6 @@ export const WebSocketProvider = ({ children }: WebSocketProviderProps) => {
|
||||
newWebSocket.onmessage = (e) => {
|
||||
try {
|
||||
const message = JSON.parse(e.data);
|
||||
console.log("[WS] Received message:", message);
|
||||
setLastMessage(message); // Store the last message in context
|
||||
} catch (error) {
|
||||
console.error("Error parsing WebSocket message:", error);
|
||||
@@ -124,12 +123,10 @@ export const WebSocketProvider = ({ children }: WebSocketProviderProps) => {
|
||||
const handlePlayCommand = useCallback(
|
||||
(data: any) => {
|
||||
if (!data || !data.ItemIds || !data.ItemIds.length) {
|
||||
console.warn("[WS] Received Play command with no items");
|
||||
return;
|
||||
}
|
||||
|
||||
const itemId = data.ItemIds[0];
|
||||
console.log(`[WS] Handling Play command for item: ${itemId}`);
|
||||
|
||||
router.push({
|
||||
pathname: "/(auth)/player/direct-player",
|
||||
|
||||
Reference in New Issue
Block a user