BASS_DSHOW setposition is not correct

Started by diystar,

diystar

On BASS latest version, BASS_DSHOW setposition is not correct, but on BASS 2.4.8.0, it is correct, why?


Ian @ un4seen

Those downloads aren't working for me (access denied).

Please give more info on what the problem is. It looks like BASS_DSHOW has its own seeking function called xVideo_ChannelSetPosition, so I guess you're using that rather than BASS_ChannelSetPosition?

diystar

Please copy the url to address bar of browser. I use Bass_ChannelSetPosition.(using xVideo_ChannelSetPosition has no effect also)

diystar

Quote from: Ian @ un4seen
Quote from: Chris@ Ian
After removing the "if (mode == BASS_POS_BYTE" it will working fine.
Maybe Bass self will change something in the internal Variable mode ?`

That "mode" check can indeed be removed from BASS_DTS_SetPosition, but the check in BASS_DTS_CanSetPosition needs updating to ignore flags (BASS_POS_FLUSH/INEXACT/etc), like this:

    if ((BYTE)mode == BASS_POS_BYTE) {

Is it related to this?

Ian @ un4seen

Quote from: diystarPlease copy the url to address bar of browser. I use Bass_ChannelSetPosition.(using xVideo_ChannelSetPosition has no effect also)

Thanks, the links do work that way. I see they're executables, and the old version has a very old BASS.DLL (2.4.8.1). Can you try some in between BASS versions to find when the problem began? Here are a few:

    www.un4seen.com/stuff/bass2411.zip
    www.un4seen.com/stuff/bass2415.zip
    www.un4seen.com/stuff/bass2416.zip

I don't have the BASS_DSHOW source code, so I'm not sure if the problem is the "mode" flags that you mention, but I guess it is possible. Can you describe the problem, eg. is BASS_ChannelSetPosition (or xVideo_ChannelSetPosition) failing or just not seeking to the right position? If it's failing, what's the error code?

diystar

@Ian
The bass2415 is correct. And the error code on v2.4.18 is 37

Ian @ un4seen

If the problem began with BASS 2.4.16 then it probably is that the plugin isn't considering BASS_ChannelSetPosition "mode" flags (as in the BASS_DTS case above), because 2.4.16 is when the BASS_POS_FLUSH flag was introduced and it's set automatically by BASS_ChannelSetPosition on playback channels (outside of a "mixtime" SYNCPROC), so there's a flag set even if you didn't specify any in the BASS_ChannelSetPosition call. Unfortunately, there isn't anything you can do about that yourself (the plugin will need to be updated to fix it).

diystar

@Ian

Could you please let users control this flag, instead of BASS adding it automatically?
That would help many old plugins work again.
 
Thank you very much.

Ian @ un4seen

Disabling the BASS_POS_FLUSH flag could cause issues with other plugins (notably BASSMIDI), and there's also another flag set by BASS_ChannelPlay/Start when restarting (this one has been set since BASS 2.4). So I think it'd be better to fix BASS_DSHOW. I've emailed the author to see if they still have the source code and can update it. If that isn't possible then I think it'll be possible to just patch the existing DLLs instead.

What other old plugins are you having the same issue with?

diystar

At present, it seems that only video plugins are experiencing this issue. The problem is not very serious.

diystar

#11
I have done a test:
The old bass_ape plugin doesn't know the flag also, but it's setposition is correct, why?

Chris

#12
In Bass_APE the SetPosition/GetPosition is controlled by Bass self, while SetPosition/GetPosition in Bass_DSShow is controlled by Bass_DSShow.
Bass_DSSHOW needs a Update.

diystar

Quote from: Ian @ un4seenDisabling the BASS_POS_FLUSH flag could cause issues with other plugins (notably BASSMIDI), and there's also another flag set by BASS_ChannelPlay/Start when restarting (this one has been set since BASS 2.4). So I think it'd be better to fix BASS_DSHOW. I've emailed the author to see if they still have the source code and can update it. If that isn't possible then I think it'll be possible to just patch the existing DLLs instead.

What other old plugins are you having the same issue with?

You could apply the BASS_POS_FLUSH flag only to normal audio streams, but not to the streams created by Bass_DShow / Bass_FFMPEG / Bass_dts.

Ian @ un4seen

Quote from: diystarI have done a test:
The old bass_ape plugin doesn't know the flag also, but it's setposition is correct, why?

Plugins don't need to be able to handle every flag. They can just ignore the flags, which is what the "(BYTE)mode == BASS_POS_BYTE" test that you quoted does. The old BASS_APE plugin does that, so it's fine.

Regarding the BASS_POS_FLUSH flag specifically, it's used by BASSMIDI for resetting all notes and effects, so that they don't reset when custom looping but do on other position changes and restarts. Most file formats don't involve playing notes or effects, so the flag can be ignored.

Quote from: diystarYou could apply the BASS_POS_FLUSH flag only to normal audio streams, but not to the streams created by Bass_DShow / Bass_FFMPEG / Bass_dts.

I don't really like the idea of BASS doing something different for particular add-ons. Better to update the add-ons (BASS_FFMPEG and BASS_DTS already have been).

diystar

#15
@Ian
I understand, thank you.

Ian @ un4seen

I haven't heard back from the BASS_DSHOW developer yet. I suspect the email address that I have is no longer in use (it's a very long time since I last mailed them). So I went ahead and patched the existing DLLs:

    www.un4seen.com/stuff/bass_dshow.zip

They're untested, so please try both the 32-bit and 64-bit DLLs, and let me if seeking is now working like before.