1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #293, add http stream cache for audio mp3/aac stream.

This commit is contained in:
winlin 2015-01-19 12:24:18 +08:00
parent e6549b261c
commit f9f2fcbb9c
4 changed files with 165 additions and 19 deletions

View file

@ -1702,7 +1702,7 @@ void SrsSource::on_unpublish()
handler->on_unpublish(this, _req);
}
int SrsSource::create_consumer(SrsConsumer*& consumer)
int SrsSource::create_consumer(SrsConsumer*& consumer, bool dump_gop_cache)
{
int ret = ERROR_SUCCESS;
@ -1750,12 +1750,15 @@ int SrsSource::create_consumer(SrsConsumer*& consumer)
srs_info("dispatch audio sequence header success");
// copy gop cache to client.
if ((ret = gop_cache->dump(consumer, atc, tba, tbv, ag)) != ERROR_SUCCESS) {
return ret;
if (dump_gop_cache) {
if ((ret = gop_cache->dump(consumer, atc, tba, tbv, ag)) != ERROR_SUCCESS) {
return ret;
}
srs_trace("create consumer, queue_size=%.2f, tba=%d, tbv=%d", queue_size, sample_rate, frame_rate);
} else {
srs_trace("create consumer, ignore gop cache, tba=%d, tbv=%d", sample_rate, frame_rate);
}
srs_trace("create consumer, queue_size=%.2f, tba=%d, tbv=%d", queue_size, sample_rate, frame_rate);
return ret;
}