Author Topic: Issues with AC3 files  (Read 545 times)

David_AVD

  • Posts: 81
Issues with AC3 files
« on: 20 Aug '23 - 01:48 »
Are there any known issues with AC3 files in regards to BASS_ChannelGetLength and BASS_ChannelSetPosition ?

My code is creating a stream with the BASS_STREAM_DECODE, BASS_SAMPLE_FLOAT, BASS_STREAM_PRESCAN and BASS_UNICODE flags.

For some files the call to BASS_ChannelGetLength doesn't seem to return a correct result.

The other issue is that a call to BASS_ChannelSetPosition fails with BASS_ERROR_UNKNOWN.

I have other code that doesn't use BASS_STREAM_DECODE or BASS_SAMPLE_FLOAT in the stream creation and it seems to work fine.

Ian @ un4seen

  • Administrator
  • Posts: 26028
Re: Issues with AC3 files
« Reply #1 on: 21 Aug '23 - 10:36 »
Please upload (or link) an affected AC3 file to have a look at here:

   ftp.un4seen.com/incoming/

Also confirm whether you are using the BASS_AC3 add-on or Media Foundation to decode the file. You can check the "ctype" via BASS_ChannelGetInfo to confirm which is being used if both are available.

David_AVD

  • Posts: 81
Re: Issues with AC3 files
« Reply #2 on: 21 Aug '23 - 22:17 »
File uploaded (matrix2_commentary1_stereo_192.eac3).

I wasn't using the BASS_AC3 add-on as it seems to play without it, but will try that shortly.
« Last Edit: 21 Aug '23 - 23:56 by David_AVD »

David_AVD

  • Posts: 81
Re: Issues with AC3 files
« Reply #3 on: 21 Aug '23 - 23:56 »
I just added in the Bass_ac3 dll and dynamic loading code. With it, the BASS_ChannelGetLength issue with the eac3 file doesn't improve.

For an ac3 that does return a result from BASS_ChannelGetLength I call BASS_ChannelSetPosition which succeeds. The subsequent call to  BASS_ChannelGetData with a data size of 5000 returns a much larger number than 5000, so causes buffer read exceptions.

I'll upload the ac3 file (sample-5.ac3) now.

Chris

  • Posts: 2210
Re: Issues with AC3 files
« Reply #4 on: 22 Aug '23 - 11:24 »
You can try this
BASS_SetConfig(BASS_CONFIG_MF_DISABLE,true);
and look if the error is gone.

Ian @ un4seen

  • Administrator
  • Posts: 26028
Re: Issues with AC3 files
« Reply #5 on: 22 Aug '23 - 14:06 »
I just added in the Bass_ac3 dll and dynamic loading code. With it, the BASS_ChannelGetLength issue with the eac3 file doesn't improve.

BASS_AC3 doesn't support EAC3, so Media Foundation would always be used for those files (you can check the "ctype" via BASS_ChannelGetInfo to confirm). The length reported by BASS_ChannelGetLength with your test file here is 35069952 (with BASS_SAMPLE_FLOAT flag), which is 1:31 and matches what other players (eg. VLC) say. Are you seeing something different there? If so, please check what length the pre-compiled CONTEST.EXE example in the BASS package (C\BIN folder) shows.

For an ac3 that does return a result from BASS_ChannelGetLength I call BASS_ChannelSetPosition which succeeds. The subsequent call to  BASS_ChannelGetData with a data size of 5000 returns a much larger number than 5000, so causes buffer read exceptions.

What is the exact BASS_ChannelGetData return value? Perhaps it's 0xFFFFFFFF (-1), indicating that the call failed? Are you having this problem with both BASS_AC3 and Media Foundation? I'm not seeing it happen with your test file here. If it's happening with a particular BASS_ChannelSetPosition parameter then please give that parameter to try here.

David_AVD

  • Posts: 81
Re: Issues with AC3 files
« Reply #6 on: 22 Aug '23 - 21:33 »
I'll do some more testing and also check the return value of BASS_ChannelGetData. Thanks.