mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 11:21:52 +00:00
Fix #1303, do not dispatch previous meta when not publishing. 3.0.109
This commit is contained in:
parent
01870cce56
commit
5d365bade8
4 changed files with 28 additions and 17 deletions
|
@ -146,6 +146,7 @@ For previous versions, please read:
|
|||
|
||||
## V3 changes
|
||||
|
||||
* v3.0, 2020-01-27, Fix [#1303][bug #1303], do not dispatch previous meta when not publishing. 3.0.109
|
||||
* v3.0, 2020-01-26, Allow use libst.so for ST is MPL license.
|
||||
* v3.0, 2020-01-26, Fix [#607][bug #607], set RTMP identifying recursive depth to 3.
|
||||
* v3.0, 2020-01-25, Fix [#878][bug #878], remove deprecated #EXT-X-ALLOW-CACHE for HLS. 3.0.108
|
||||
|
@ -1628,6 +1629,7 @@ Winlin
|
|||
[bug #703]: https://github.com/ossrs/srs/issues/703
|
||||
[bug #878]: https://github.com/ossrs/srs/issues/878
|
||||
[bug #607]: https://github.com/ossrs/srs/issues/607
|
||||
[bug #1303]: https://github.com/ossrs/srs/issues/1303
|
||||
[bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx
|
||||
|
||||
[exo #828]: https://github.com/google/ExoPlayer/pull/828
|
||||
|
|
|
@ -903,6 +903,11 @@ srs_error_t SrsOriginHub::cycle()
|
|||
return err;
|
||||
}
|
||||
|
||||
bool SrsOriginHub::active()
|
||||
{
|
||||
return is_active;
|
||||
}
|
||||
|
||||
srs_error_t SrsOriginHub::on_meta_data(SrsSharedPtrMessage* shared_metadata, SrsOnMetaDataPacket* packet)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
@ -2475,6 +2480,8 @@ srs_error_t SrsSource::create_consumer(SrsConnection* conn, SrsConsumer*& consum
|
|||
}
|
||||
}
|
||||
|
||||
// If stream is publishing, dumps the sequence header and gop cache.
|
||||
if (hub->active()) {
|
||||
// Copy metadata and sequence header to consumer.
|
||||
if ((err = meta->dumps(consumer, atc, jitter_algorithm, dm, ds)) != srs_success) {
|
||||
return srs_error_wrap(err, "meta dumps");
|
||||
|
@ -2484,12 +2491,13 @@ srs_error_t SrsSource::create_consumer(SrsConnection* conn, SrsConsumer*& consum
|
|||
if (dg && (err = gop_cache->dump(consumer, atc, jitter_algorithm)) != srs_success) {
|
||||
return srs_error_wrap(err, "gop cache dumps");
|
||||
}
|
||||
}
|
||||
|
||||
// print status.
|
||||
if (dg) {
|
||||
srs_trace("create consumer, queue_size=%.2f, jitter=%d", queue_size, jitter_algorithm);
|
||||
srs_trace("create consumer, active=%d, queue_size=%.2f, jitter=%d", hub->active(), queue_size, jitter_algorithm);
|
||||
} else {
|
||||
srs_trace("create consumer, ignore gop cache, jitter=%d", jitter_algorithm);
|
||||
srs_trace("create consumer, active=%d, ignore gop cache, jitter=%d", hub->active(), jitter_algorithm);
|
||||
}
|
||||
|
||||
// for edge, when play edge stream, check the state
|
||||
|
|
|
@ -330,7 +330,6 @@ class SrsOriginHub : public ISrsReloadHandler
|
|||
private:
|
||||
SrsSource* source;
|
||||
SrsRequest* req;
|
||||
// Whether the stream hub is active, or stream is publishing.
|
||||
bool is_active;
|
||||
private:
|
||||
// The format, codec information.
|
||||
|
@ -364,6 +363,8 @@ public:
|
|||
// Cycle the hub, process some regular events,
|
||||
// For example, dispose hls in cycle.
|
||||
virtual srs_error_t cycle();
|
||||
// Whether the stream hub is active, or stream is publishing.
|
||||
virtual bool active();
|
||||
public:
|
||||
// When got a parsed metadata.
|
||||
virtual srs_error_t on_meta_data(SrsSharedPtrMessage* shared_metadata, SrsOnMetaDataPacket* packet);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
// The version config.
|
||||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 108
|
||||
#define VERSION_REVISION 109
|
||||
|
||||
// The macros generated by configure script.
|
||||
#include <srs_auto_headers.hpp>
|
||||
|
|
Loading…
Reference in a new issue