Fix #1548, Add edts in MP4 for Windows10. 3.0.154

pull/2138/head
winlin 4 years ago
parent 721173e6af
commit ab5ddd24e2

@ -145,6 +145,7 @@ For previous versions, please read:
## V3 changes
* v3.0, 2020-12-17, Fix [#1548][bug #1548], Add edts in MP4 for Windows10. 3.0.154
* <strong>v3.0, 2020-10-31, [3.0 release2(3.0.153)][r3.0r2] released. 122663 lines.</strong>
* v3.0, 2020-10-31, Fix [#509][bug #509], Always malloc stack on heap. 3.0.153
* v3.0, 2020-10-31, Remove some global elements for debugging. 3.0.152
@ -1707,6 +1708,7 @@ Winlin
[bug #1629]: https://github.com/ossrs/srs/issues/1629
[bug #1780]: https://github.com/ossrs/srs/issues/1780
[bug #1987]: https://github.com/ossrs/srs/issues/1987
[bug #1548]: https://github.com/ossrs/srs/issues/1548
[bug #yyyyyyyyyyyyy]: https://github.com/ossrs/srs/issues/yyyyyyyyyyyyy
[exo #828]: https://github.com/google/ExoPlayer/pull/828

@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION3_HPP
#define SRS_CORE_VERSION3_HPP
#define SRS_VERSION3_REVISION 153
#define SRS_VERSION3_REVISION 154
#endif

@ -1758,6 +1758,12 @@ void SrsMp4TrackBox::set_tkhd(SrsMp4TrackHeaderBox* v)
boxes.insert(boxes.begin(), v);
}
void SrsMp4TrackBox::set_edts(SrsMp4EditBox* v)
{
remove(SrsMp4BoxTypeEDTS);
boxes.insert(boxes.begin(), v);
}
SrsMp4ChunkOffsetBox* SrsMp4TrackBox::stco()
{
SrsMp4SampleTableBox* box = stbl();
@ -2022,6 +2028,12 @@ SrsMp4EditBox::~SrsMp4EditBox()
{
}
void SrsMp4EditBox::set_elst(SrsMp4EditListBox* v)
{
remove(SrsMp4BoxTypeELST);
boxes.insert(boxes.begin(), v);
}
SrsMp4ElstEntry::SrsMp4ElstEntry() : segment_duration(0), media_time(0), media_rate_integer(0)
{
media_rate_fraction = 0;
@ -5773,6 +5785,18 @@ srs_error_t SrsMp4Encoder::flush()
if (nb_videos || !pavcc.empty()) {
SrsMp4TrackBox* trak = new SrsMp4TrackBox();
moov->add_trak(trak);
SrsMp4EditBox* edts = new SrsMp4EditBox();
trak->set_edts(edts);
SrsMp4EditListBox* elst = new SrsMp4EditListBox();
edts->set_elst(elst);
elst->version = 0;
SrsMp4ElstEntry entry;
entry.segment_duration = mvhd->duration_in_tbn;
entry.media_rate_integer = 1;
elst->entries.push_back(entry);
SrsMp4TrackHeaderBox* tkhd = new SrsMp4TrackHeaderBox();
trak->set_tkhd(tkhd);

@ -71,6 +71,8 @@ class SrsMp4TrackFragmentBox;
class SrsMp4TrackFragmentHeaderBox;
class SrsMp4TrackFragmentDecodeTimeBox;
class SrsMp4TrackFragmentRunBox;
class SrsMp4EditBox;
class SrsMp4EditListBox;
// 4.2 Object Structure
// ISO_IEC_14496-12-base-format-2012.pdf, page 16
@ -766,6 +768,8 @@ public:
// Get the track header box.
virtual SrsMp4TrackHeaderBox* tkhd();
virtual void set_tkhd(SrsMp4TrackHeaderBox* v);
// Set the EDTS box.
virtual void set_edts(SrsMp4EditBox* v);
public:
// Get the chunk offset box.
virtual SrsMp4ChunkOffsetBox* stco();
@ -874,6 +878,8 @@ class SrsMp4EditBox : public SrsMp4Box
public:
SrsMp4EditBox();
virtual ~SrsMp4EditBox();
public:
virtual void set_elst(SrsMp4EditListBox* v);
};
// 8.6.6 Edit List Box

Loading…
Cancel
Save