Skip to content

Commit

Permalink
Increase max allowed sample size
Browse files Browse the repository at this point in the history
+10% to sample size.

This is aimed H264 samples only. While +10000 needed for audio.
  • Loading branch information
SuslikV authored Sep 10, 2017
1 parent 925a4de commit cd92eb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mp4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void Mp4::repair(string filename) {
}

//sampleBuffMaxlength = (int32_t) track.sizesMinMax[1] *2; //max twice bigger//* samplesCount; //max sample size * samples count = max possible chunk size; casting due to ffmpeg AV packet size is int32_t
sampleBuffMaxlength = track.sizesMinMax[1] +10000; //!!!bigger samples almost not possible; assumption by own experience, subject to change
sampleBuffMaxlength = track.sizesMinMax[1] +10000 + uint32_t(track.sizesMinMax[1] * 0.10); //!!!bigger samples almost not possible; assumption by own experience, subject to change
if (sampleBuffMaxlength > (smplBufEnd - smplBufStart)) {
logMe(LOG_DBG, "Current chunk may require bigger buffer storage.");
sampleBuffMaxlength = (int32_t) (smplBufEnd - smplBufStart); //casting due to ffmpeg AV packet size is int32_t
Expand Down

0 comments on commit cd92eb7

Please sign in to comment.