mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +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
|
@ -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…
Add table
Add a link
Reference in a new issue