mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 01:02:12 +00:00
never-ending mp3 saga
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9172 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
270ef7f67d
commit
948557162f
@ -223,13 +223,13 @@ static size_t decode_fd(shout_context_t *context, void *data, size_t bytes)
|
|||||||
int dlen = 0;
|
int dlen = 0;
|
||||||
int x = 0;
|
int x = 0;
|
||||||
char *in;
|
char *in;
|
||||||
int inlen;
|
int inlen = 0;
|
||||||
char *out;
|
char *out;
|
||||||
int outlen;
|
int outlen;
|
||||||
int usedlen;
|
int usedlen;
|
||||||
char inbuf[MP3_SCACHE];
|
char inbuf[MP3_SCACHE];
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
size_t used;
|
||||||
size_t lp;
|
size_t lp;
|
||||||
size_t rb = 0;
|
size_t rb = 0;
|
||||||
|
|
||||||
@ -248,7 +248,6 @@ static size_t decode_fd(shout_context_t *context, void *data, size_t bytes)
|
|||||||
x = 0;
|
x = 0;
|
||||||
|
|
||||||
if (inlen < bytes) {
|
if (inlen < bytes) {
|
||||||
bytes = inlen;
|
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,8 +309,10 @@ static size_t decode_fd(shout_context_t *context, void *data, size_t bytes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (done || switch_buffer_inuse(context->audio_buffer) >= bytes) {
|
used = switch_buffer_inuse(context->audio_buffer);
|
||||||
rb = switch_buffer_read(context->audio_buffer, data, bytes);
|
|
||||||
|
if (done || used >= bytes) {
|
||||||
|
rb = switch_buffer_read(context->audio_buffer, data, used);
|
||||||
return rb;
|
return rb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user