File tree Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,8 @@ await Task.Run(() =>
216
216
}
217
217
}
218
218
219
+ public static string EndOfFFMPEGLine = "final ratefactor:" ;
220
+
219
221
private static int _Run (
220
222
Context context ,
221
223
string cmd ,
@@ -247,20 +249,41 @@ private static int _Run(
247
249
process . Start ( ) ;
248
250
249
251
250
- Task . Run ( ( ) =>
252
+ Task . Run ( async ( ) =>
251
253
{
252
- using ( var reader = process . StandardError )
254
+ try
253
255
{
254
- string processOutput = "" ;
255
- do
256
+ using ( var reader = process . StandardError )
256
257
{
257
- var line = reader . ReadLine ( ) ;
258
- if ( line == null )
259
- break ;
260
- logger ? . Invoke ( line ) ;
261
- processOutput += line ;
262
- } while ( ! finished ) ;
263
- error = processOutput ;
258
+ string processOutput = "" ;
259
+ do
260
+ {
261
+ var line = reader . ReadLine ( ) ;
262
+ if ( line == null )
263
+ break ;
264
+ logger ? . Invoke ( line ) ;
265
+ processOutput += line ;
266
+
267
+
268
+ if ( line . StartsWith ( EndOfFFMPEGLine ) )
269
+ {
270
+ // we are assuming that process has finished.. we will exit forcefully
271
+ // after 1 minute...
272
+ await Task . Delay ( TimeSpan . FromMinutes ( 1 ) ) ;
273
+
274
+ System . Diagnostics . Debug . WriteLine ( "Forcing ffmpeg to exit.." ) ;
275
+
276
+ process . Kill ( ) ;
277
+ }
278
+
279
+ } while ( ! finished ) ;
280
+ error = processOutput ;
281
+
282
+
283
+ }
284
+ }
285
+ catch ( Exception ex ) {
286
+ System . Diagnostics . Debug . WriteLine ( ex ) ;
264
287
}
265
288
} ) ;
266
289
Original file line number Diff line number Diff line change 26
26
// You can specify all the values or you can default the Build and Revision Numbers
27
27
// by using the '*' as shown below:
28
28
// [assembly: AssemblyVersion("1.0.*")]
29
- [ assembly: AssemblyVersion ( "1.0.27 .*" ) ]
29
+ [ assembly: AssemblyVersion ( "1.0.28 .*" ) ]
30
30
Original file line number Diff line number Diff line change 2
2
<package >
3
3
<metadata >
4
4
<id >Xamarin.Android.FFmpeg</id >
5
- <version >1.0.27 </version >
5
+ <version >1.0.28 </version >
6
6
<title >FFmpeg binding for Xamarin Android</title >
7
7
<authors >akash.kava</authors >
8
8
<owners ></owners >
You can’t perform that action at this time.
0 commit comments