Fixes for playlist support

Track matching fixes:
  Input MP4 is not getting dimensions properly, causing resume to not find a collision
    Fixed by overwriting dimensions when media frames are read
  Detecting collisions using track identifier can cause issues (ie audio_AAC_2ch_44100hz_eng VS audio_AAC_2ch_44100hz)
    Fixed by matching using init data, then check by identifier if there is more than 1 match

Fixed buffering code for playlist streams, ensuring correct page creation:
  In resume mode new pages do not get created, but existing one(s) fill up
    Keyframes were not being recognized due to them being deleted during track switching
      Fixed by changing negotiationProxy::bufferNext:
        Removed seemingly unnecessary function which cleared keyframes
      Lastly, the offset of a resumed track seems wrong
        Added to NegotiationProxy::continueNegotiate
          pagesByTrack[tid][firstPage].curOffset = 0;
        Added to negotiationProxy::bufferSinglePacket:
          if (!pagesByTrack[tid][currentPageNum].curOffset) {
            pagesByTrack[tid][currentPageNum].firstTime = packet.getTime();
          }

Fixed numbering for keys from the buffer when accepting tracks (was amount of buffered keys, not last key number)
This commit is contained in:
Marco 2021-02-15 14:16:47 +01:00 committed by Thulinma
parent 01b65ed301
commit c9cd529927
3 changed files with 37 additions and 16 deletions

View file

@ -289,10 +289,10 @@ namespace Mist{
MP4::VisualSampleEntry & vEntryBox = (MP4::VisualSampleEntry&)sEntryBox;
myMeta.tracks[trackNo].type = "video";
myMeta.tracks[trackNo].codec = "H264";
if (!myMeta.tracks[trackNo].width){
myMeta.tracks[trackNo].width = vEntryBox.getWidth();
myMeta.tracks[trackNo].height = vEntryBox.getHeight();
}
myMeta.tracks[trackNo].width = vEntryBox.getWidth();
myMeta.tracks[trackNo].height = vEntryBox.getHeight();
MP4::Box initBox = vEntryBox.getCLAP();
if (initBox.isType("avcC")){
myMeta.tracks[trackNo].init.assign(initBox.payload(), initBox.payloadSize());