mirror of
https://github.com/openharmony/third_party_tinyalsa.git
synced 2026-07-19 15:24:22 -04:00
pcm: more state checking in pcm_get_htimestamp()
pcm_get_htimestamp() should return an error if stream state is not running or draining as the time stamp returned by the driver is not valid in other states. Change-Id: Icdfe9554b26f57119d7a8d762a6ea6e8e3eaf370
This commit is contained in:
committed by
Simon Wilson
parent
ee9ba87d9b
commit
7db48587ba
@@ -333,7 +333,8 @@ int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail,
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
if (pcm->mmap_status->state == PCM_STATE_XRUN)
|
||||
if ((pcm->mmap_status->state != PCM_STATE_RUNNING) &&
|
||||
(pcm->mmap_status->state != PCM_STATE_DRAINING))
|
||||
return -1;
|
||||
|
||||
*tstamp = pcm->mmap_status->tstamp;
|
||||
|
||||
Reference in New Issue
Block a user