Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 92b59c7 in mainline


Ignore:
Timestamp:
2013-03-16T15:14:58Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
6606378
Parents:
39a379a
Message:

dplay: Update buffer position after starting playback.

By the time we return from the call it might have moved quite a bit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/wavplay/dplay.c

    r39a379a r92b59c7  
    212212        printf("Playing: %dHz, %s, %d channel(s).\n", pb->f.sampling_rate,
    213213            pcm_sample_format_str(pb->f.sample_format), pb->f.channels);
    214         useconds_t work_time = 70000; /* 10 ms */
     214        useconds_t work_time = 20000; /* 20 ms */
    215215        bool started = false;
    216216        size_t pos = 0;
     
    239239
    240240                if (!started) {
    241                         const int ret = audio_pcm_start_playback(pb->device,
     241                        int ret = audio_pcm_start_playback(pb->device,
    242242                            pb->f.channels, pb->f.sampling_rate,
    243243                            pb->f.sample_format);
     
    247247                        }
    248248                        started = true;
     249                        ret = audio_pcm_get_buffer_pos(pb->device, &pos);
     250                        if (ret != EOK) {
     251                                printf("Failed to update position indicator\n");
     252                        }
    249253                }
    250254                const size_t to_play = buffer_occupied(pb, pos);
Note: See TracChangeset for help on using the changeset viewer.