Getting stuttering during rendering of my DirectShow filter despite output file being “smooth”

大城市里の小女人 提交于 2019-12-08 19:28:31

First of all, to troubleshoot audio output you want to check renderer properties. advanced tabs gets you those and you can also query them via IAMAudioRendererStats interface programmatically. Things different from properties in file playback should be a warning for you as for correctness of streaming.

Because audio property pages in stock filters are made not as rock solid as those for DriectShow video filters, you might need a trick to pop this up. In your applciation when streaming is active use OleCreatePropertyFrame to show filter protperties right from your code, from GUI thread (e.g. such as a response to pressing some temporary button).

As for typical causes of playback issues, I'd be checking the following:

  • You don't time stamp samples, and thye are played back in the pace of being pushed, and you are sometimes pushing stuff later than previous sample playback is completed
  • Your time stamps looks correct, but they are set back from current playback time and they appear, possibly partially, late for the renderer

Both scenarios should have some reflection on the Advanced tab data.

Can you try to change

    // Ensure a minimum number of buffers
    if (Properties.cBuffers = 0) then
        Properties.cBuffers := 2;

into

    // Ensure a minimum number of buffers
    if (Properties.cBuffers < 2) then
        Properties.cBuffers := 2;

To make sure you have at least two buffers. If you have only one buffer you would hear gaps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!