diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index 077b0f3c9..59d436a2c 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -462,6 +462,9 @@ srs_error_t SrsHlsMuxer::segment_open() if ((err = current->writer->open(tmp_file)) != srs_success) { return srs_error_wrap(err, "open hls muxer"); } + + // reset the context for a new ts start. + context->reset(); return err; } diff --git a/trunk/src/app/srs_app_hls.hpp b/trunk/src/app/srs_app_hls.hpp index cb95ac738..5d7535f1c 100644 --- a/trunk/src/app/srs_app_hls.hpp +++ b/trunk/src/app/srs_app_hls.hpp @@ -157,7 +157,8 @@ private: // The key and iv. unsigned char key[16]; unsigned char iv[16]; - SrsFileWriter *writer; + // The underlayer file writer. + SrsFileWriter* writer; private: int _sequence_no; srs_utime_t max_td;