mplayer从属模式-观看后无法删除文件

发布于 2024-09-12 04:34:43 字数 413 浏览 1 评论 0原文

我在 Windows 上的 .NET 和 Linux 上的 Mono 中运行的 C# 应用程序中使用 mplayer。我使用 Process.Start 启动 mplayer 并在 -slave -idle 中运行它。

要播放视频,我会像这样写入标准输入:

loadfile {filename}

当我准备好播放下一个视频时,我会使用新文件名再次调用 loadfile。

问题:如果我播放视频,然后有时去删除该文件,我不能 - 在 Windows 上我得到“该进程无法访问该文件,因为它正在被另一个进程使用”。我检查 Process Explorer 并发现 mplayer 仍然有一个打开的文件句柄,即使它在一段时间前完成了播放。

关于如何让 mplayer 释放已播放完毕的文件的句柄,有什么想法吗?

提前致谢

I'm using mplayer in my C# app running in .NET on Windows and Mono on Linux. I start mplayer using Process.Start and run it in -slave -idle.

To play a video, I write to stdin like this:

loadfile {filename}

When I'm ready to play the next video, I call loadfile again with the new filename.

Problem: if I play a video and then sometime go to delete that file, I can't - on Windows I get "The process cannot access the file because it is being used by another process". I check with Process Explorer and see that mplayer still has a handle open on the file, even though it finished playing it some time ago.

Any ideas on how I can get mplayer to release handles on files that it has finished playing?

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦途 2024-09-19 04:34:43

使用管道

Use a pipe.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文