mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 11:21:52 +00:00
ensure the HLS(ts) is continous when republish stream.
This commit is contained in:
parent
e262147e81
commit
9080c2e559
4 changed files with 21 additions and 4 deletions
|
@ -212,6 +212,7 @@ usr sys idl wai hiq siq| read writ| recv send| in out | int csw
|
|||
* nginx v1.5.0: 139524 lines <br/>
|
||||
|
||||
### History
|
||||
* v0.9, 2013-12-15, ensure the HLS(ts) is continous when republish stream.
|
||||
* v0.9, 2013-12-15, fix the hls reload bug, feed it the sequence header.
|
||||
* v0.9, 2013-12-15, refine protocol, use int64_t timestamp for ts and jitter.
|
||||
* v0.9, 2013-12-15, support set the live queue length(in seconds), drop when full.
|
||||
|
|
|
@ -1332,12 +1332,12 @@ int SrsHls::on_video(SrsSharedPtrMessage* video)
|
|||
return ret;
|
||||
}
|
||||
|
||||
_mpegts();
|
||||
hls_mux();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SrsHls::_mpegts()
|
||||
void SrsHls::hls_mux()
|
||||
{
|
||||
// reportable
|
||||
if (pithy_print->can_print()) {
|
||||
|
|
|
@ -217,13 +217,30 @@ public:
|
|||
SrsHls(SrsSource* _source);
|
||||
virtual ~SrsHls();
|
||||
public:
|
||||
/**
|
||||
* publish stream event, continue to write the m3u8,
|
||||
* for the muxer object not destroyed.
|
||||
*/
|
||||
virtual int on_publish(SrsRequest* req);
|
||||
/**
|
||||
* the unpublish event, only close the muxer, donot destroy the
|
||||
* muxer, for when we continue to publish, the m3u8 will continue.
|
||||
*/
|
||||
virtual void on_unpublish();
|
||||
/**
|
||||
* get some information from metadata, it's optinal.
|
||||
*/
|
||||
virtual int on_meta_data(SrsAmf0Object* metadata);
|
||||
/**
|
||||
* mux the audio packets to ts.
|
||||
*/
|
||||
virtual int on_audio(SrsSharedPtrMessage* audio);
|
||||
/**
|
||||
* mux the video packets to ts.
|
||||
*/
|
||||
virtual int on_video(SrsSharedPtrMessage* video);
|
||||
private:
|
||||
virtual void _mpegts();
|
||||
virtual void hls_mux();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -546,7 +546,6 @@ int SrsSource::on_reload_hls(string vhost)
|
|||
return ret;
|
||||
}
|
||||
|
||||
// TODO: HLS should continue previous sequence and stream.
|
||||
#ifdef SRS_HLS
|
||||
hls->on_unpublish();
|
||||
if ((ret = hls->on_publish(req)) != ERROR_SUCCESS) {
|
||||
|
|
Loading…
Reference in a new issue