Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Lukasz Marek authored on 2014/04/30 07:25:13... | ... |
@@ -624,6 +624,7 @@ static int pulse_write_packet(AVFormatContext *h, AVPacket *pkt) |
624 | 624 |
{ |
625 | 625 |
PulseData *s = h->priv_data; |
626 | 626 |
int ret; |
627 |
+ int64_t writable_size; |
|
627 | 628 |
|
628 | 629 |
if (!pkt) |
629 | 630 |
return pulse_flash_stream(s); |
... | ... |
@@ -658,6 +659,9 @@ static int pulse_write_packet(AVFormatContext *h, AVPacket *pkt) |
658 | 658 |
av_log(s, AV_LOG_ERROR, "pa_stream_write failed: %s\n", pa_strerror(ret)); |
659 | 659 |
goto fail; |
660 | 660 |
} |
661 |
+ if ((writable_size = pa_stream_writable_size(s->stream)) >= s->minreq) |
|
662 |
+ avdevice_dev_to_app_control_message(h, AV_DEV_TO_APP_BUFFER_WRITABLE, &writable_size, sizeof(writable_size)); |
|
663 |
+ |
|
661 | 664 |
pa_threaded_mainloop_unlock(s->mainloop); |
662 | 665 |
|
663 | 666 |
return 0; |