Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#107 DirectShowSource option to force audio channel count

open
Ian Brabham
Filters (44)
5
2014-08-10
2013-02-27
pspost
No

Hi!

DirectShowSource loaded movie file with 6 channels PCM audio. However it was definitely stereo. GraphStudioNext renders graph with filters all have 2 channel In/Out pins.

My fix.
I downloaded sources of DirectShowSource plugin and added one line:

HRESULT GetSample::InternalQueryAccept(const AM_MEDIA_TYPE* pmt, VideoInfo &vi)
...........................................
WAVEFORMATEX* wex = (WAVEFORMATEX*)pmt->pbFormat;

>>>> if(wex->nChannels != 2) return S_FALSE;

I hardcoded stereo here and it solved my issue. It successfully passed then with value
wex->nChannels == 2.

Maybe you should add it as an option in DirectShowSource constructor if one wants to try force channels count.

Also I found this topic so the problem is not only mine:
http://forum.doom9.org/archive/index.php/t-160109.html

Discussion

  • Ian Brabham
    Ian Brabham
    2013-03-05

    Of course your patch disallows any mono or genuine multi channel pin connections.

    But I see your problem, the audio decoder bids 6 channel first even for stereo sources, DirectShowSource accepts the bid. With your patch, you refuse the 6 channel bid, so it next bids 2 channel, which you then accept.

    Which audio decoder is giving this behaviour?

    I have reassigned this as a Feature Request "DirectShowSource option to force audio channel count"

     
  • Ian Brabham
    Ian Brabham
    2013-03-05

    • labels: 438410 --> Filters
    • status: open --> open-accepted
     
  • Ian Brabham
    Ian Brabham
    2013-03-05

    • summary: DirectShowSource wrong channels count --> DirectShowSource option to force audio channel count
    • assigned_to: nobody --> ianb1957
    • milestone: 267420 -->
     
  • pspost
    pspost
    2013-03-20

    • status: open-accepted --> open
     
  • pspost
    pspost
    2013-03-20

    Sorry for late respond

    >>Which audio decoder is giving this behaviour?
    I dont know. How can I find it put?

    My graph looks like this:
    1. Haali Media Splitter 1.11.288.0
    2. Microsoft DTV-DVD Audio Decoder
    3. ffdshow Audio Decoder
    4. Default DirectSound Device