FFmpeg-Android icon indicating copy to clipboard operation
FFmpeg-Android copied to clipboard

fixing ANR on large files

Open alexcohn opened this issue 6 years ago • 1 comments

see https://stackoverflow.com/q/57067507/192373

  1. use StringBuilder to accumulate the output text
  2. convert it to String inside doInBackground, not on Main thread

alexcohn avatar Aug 07 '19 20:08 alexcohn

Actually, I don't think it's always necessary to aggregate all intermediate output lines into one huge output string. In the case the output is short, and especially if onProgress() is empty, it may be OK. But for big files, this puts too much stress on the Garbage Collector, and the info is available anyways, timely: in the overridden ExecuteBinaryResponseHandler.onProgress() callback.

alexcohn avatar Aug 07 '19 20:08 alexcohn