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

MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)

* MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296)

1. Refresh HLS audio codec if changed in stream.
2. Refresh TS audio codec if changed in stream.
3. Fix mp3 demux bug in SrsFormat::audio_mp3_demux.
4. Use 3(MPEG1) not 4(MPEG2) as PMT stream type, follow FFmpeg.
5. MP3: Update utest for mp3 sample parsing.
6. MP3: Ignore empty frame sample.
7. UTest: Fix utest failed, do not copy files.
This commit is contained in:
Winlin 2022-12-25 11:43:26 +08:00 committed by GitHub
parent 2573a25101
commit 577cd299e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 109 additions and 38 deletions

View file

@ -156,6 +156,9 @@ private:
SrsHlsSegment* current;
// The ts context, to keep cc continous between ts.
SrsTsContext* context;
private:
// Latest audio codec, parsed from stream.
SrsAudioCodecId latest_acodec_;
public:
SrsHlsMuxer();
virtual ~SrsHlsMuxer();
@ -166,6 +169,9 @@ public:
virtual std::string ts_url();
virtual srs_utime_t duration();
virtual int deviation();
public:
SrsAudioCodecId latest_acodec();
void set_latest_acodec(SrsAudioCodecId v);
public:
// Initialize the hls muxer.
virtual srs_error_t initialize();