mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-08-27 04:37:41 +00:00
Write the original H.264 SPS if it required no fixups
This commit is contained in:
@@ -1781,6 +1781,7 @@ void FFmpegVideoDecoder::writeBuffer(PLENTRY entry, int& offset)
|
||||
|
||||
// Fixup the SPS to what OS X needs to use hardware acceleration
|
||||
// This is also critical for decoding latency on the Pi 2.
|
||||
if (stream->sps->num_ref_frames != 1 || stream->sps->vui.max_dec_frame_buffering != 1) {
|
||||
stream->sps->num_ref_frames = 1;
|
||||
stream->sps->vui.max_dec_frame_buffering = 1;
|
||||
|
||||
@@ -1808,6 +1809,14 @@ void FFmpegVideoDecoder::writeBuffer(PLENTRY entry, int& offset)
|
||||
// Copy the NALU prefix over from the original SPS
|
||||
memcpy(&m_DecodeBuffer.data()[initialOffset], entry->data, nalStart);
|
||||
offset += nalStart;
|
||||
}
|
||||
else {
|
||||
// Write the SPS as-is if it required no modification
|
||||
memcpy(&m_DecodeBuffer.data()[offset],
|
||||
entry->data,
|
||||
entry->length);
|
||||
offset += entry->length;
|
||||
}
|
||||
|
||||
h264_free(stream);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user