简体   繁体   English

libVLC创建两个音频流

[英]libVLC creates two audio streams

I'm using libVLC to play a video file. 我正在使用libVLC播放视频文件。 If I use my code in as standalone video player, I am having no issues. 如果我将代码用作独立的视频播放器,则没有任何问题。 The video plays very well. 视频播放得很好。 I can pause and play the video as I like. 我可以随意暂停并播放视频。

When I use the same code, without modifications, in a plugin, and then play the same file , something unique happens: VLC creates two audio streams for the same video file. 当我在插件中使用相同的代码而不进行修改时,然后播放相同的文件时 ,会发生一些独特的事情:VLC为相同的视频文件创建两个音频流。 Now if I pause the video using libvlc_media_player_pause(...) , it pauses the video and one audio stream. 现在,如果我使用libvlc_media_player_pause(...)暂停视频,它将暂停视频和一个音频流。 The other audio stream continues playing. 另一个音频流继续播放。

Any suggestions as to why this could be happening? 关于为什么会发生这种情况的任何建议?

The application itself is written in Qt5. 该应用程序本身是用Qt5编写的。 I have tested this issue with both audio and video files. 我已经用音频和视频文件测试了此问题。

LibVLC version is 3.0.0 LibVLC版本是3.0.0

Header file and Source file are pastebin links 头文件源文件是pastebin链接

The mistake I did was in the code for plugin. 我犯的错误是在插件代码中。 Two instances of NBAVPlayer were created in the plugin code leading to two audio streams, one visible video stream and one hidden video stream. 在插件代码中创建了两个NBAVPlayer实例,导致两个音频流,一个可见视频流和一个隐藏视频流。 I have fixed the issue with the plugin, and now everything works properly. 我已经解决了插件问题,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM