rollback buffer belongs to the base class, CAudioOutUnix. The cleanup/reset belongs there too.

In hxaudply.cpp, there is already a block of code (just below your change) to handle the special case that the last stream is removed from the list. The change, if any, should go in there I think. The list search fix though should be in the first block and is a good catch.

I don't think the additional logic of resetting the audio player and audio session when last stream is removed is correct in general. It may work for your single audio-only playback case but for more complicated cases (e.g. 20s video and 10s audio starts at the same time) Audio player is supposed to continue providing fake timeline after all its audio streams are gone (this is evidential from the logic handling AUD_PLYR_STR_REMOVE and (0 == m_pStreamList->GetCount()), namely the ResumeFakeTimeLine() call). If you reset the player and session, likely you'll lose the timeline continuity.

fxd

Gurpreet wrote:
Synopsis:
Changes to reset and remove audio stream from audio device when decoders dynamically switch sample rate and Resampler is disabled.

Overview:
Some decoders may want to change sample rate dynamically i.e AAC SBR decoder doubles the sample rate after implicitly detecting sbr payload.
If  resampler is off this case is not handled and we hear no audio.
Now for this we remove the old stream from audio player and add a new stream to the audio player. Changes have been done to audio service to reset the player when stream count reaches zero so that we would be able to set it with new sample rate. Also when removing old stream we find it using IHXAudioStream pointer instead of earlier IHXAudioStream3 pointer this is because we set IHXAudioStream pointer in list when adding a stream. A minor fix is also added to audio device on android to delete the rollback buffer so that new rollback buffer can be created with sample rate size.

Files Modified:
client/audiosvc/hxaudply.cpp
audio/device/platform/unix/audAndroid.cpp
datatype/common/audrend/audrend.cpp

Platforms and Profiles Build Verified:
BIF branch  -> atlas 361
Target(s)   -> android_all
Profile     -> helix-client-android-surf_8x50
SYSTEM_ID   -> android-donut-arm-qsd_8x50

Branch:
Atlas361

Files Attached:
Audrend.diff
audply.diff
audAnd.diff

Best Regards,
Gurpreet


_______________________________________________
Audio-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/audio-dev

Reply via email to