diff --git a/media/libcubeb/README_MOZILLA b/media/libcubeb/README_MOZILLA index 2afd5eefdf00..e6bb1b87ef8e 100644 --- a/media/libcubeb/README_MOZILLA +++ b/media/libcubeb/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The cubeb git repository is: git://github.com/kinetiknz/cubeb.git -The git commit ID used was c9c97571980ca77c990a763802c11682a332cbd6. +The git commit ID used was bfaee9a6c7a15dfe8ae2ffda8dcd156d5a562010. diff --git a/media/libcubeb/src/cubeb_opensl.c b/media/libcubeb/src/cubeb_opensl.c index 5f73dd3c644d..0d9aa472f35a 100644 --- a/media/libcubeb/src/cubeb_opensl.c +++ b/media/libcubeb/src/cubeb_opensl.c @@ -52,8 +52,9 @@ struct cubeb_stream { }; static void -bufferqueue_callback(SLBufferQueueItf caller, struct cubeb_stream *stm) +bufferqueue_callback(SLBufferQueueItf caller, void * user_ptr) { + cubeb_stream * stm = user_ptr; SLBufferQueueState state; (*stm->bufq)->GetState(stm->bufq, &state); @@ -78,8 +79,13 @@ bufferqueue_callback(SLBufferQueueItf caller, struct cubeb_stream *stm) return; } - (*stm->bufq)->Enqueue(stm->bufq, buf, written * stm->framesize); - stm->queuebuf_idx = (stm->queuebuf_idx + 1) % NBUFS; + if (written) { + (*stm->bufq)->Enqueue(stm->bufq, buf, written * stm->framesize); + stm->queuebuf_idx = (stm->queuebuf_idx + 1) % NBUFS; + } else if (!i) { + stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_DRAINED); + return; + } if ((written * stm->framesize) < stm->queuebuf_len) { stm->draining = 1; diff --git a/media/libcubeb/update.sh b/media/libcubeb/update.sh index f3cfc0e3d07d..383268b5f217 100644 --- a/media/libcubeb/update.sh +++ b/media/libcubeb/update.sh @@ -27,7 +27,7 @@ if [ -n "$rev" ]; then version=$version-dirty echo "WARNING: updating from a dirty git repository." fi - sed -i.bak -e "/The git commit ID used was/ s/[0-9a-f]\+\(-dirty\)\?\./$version./" README_MOZILLA + sed -i.bak -e "/The git commit ID used was/ s/[0-9a-f]\{40\}\(-dirty\)\{0,1\}\./$version./" README_MOZILLA rm README_MOZILLA.bak else echo "Remember to update README_MOZILLA with the version details."