[longomatch] Dispose the player properly after an error opening a file
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Dispose the player properly after an error opening a file
- Date: Tue, 6 Apr 2010 00:26:51 +0000 (UTC)
commit 92c11a42ebbcc4d3d458e61140aa200c6eb90c3f
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Apr 5 16:10:15 2010 +0200
Dispose the player properly after an error opening a file
CesarPlayer/Utils/MediaFile.cs | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/CesarPlayer/Utils/MediaFile.cs b/CesarPlayer/Utils/MediaFile.cs
index 7464486..9abaa80 100644
--- a/CesarPlayer/Utils/MediaFile.cs
+++ b/CesarPlayer/Utils/MediaFile.cs
@@ -137,7 +137,7 @@ namespace LongoMatch.Video.Utils
int height=0;
int width=0;
MultimediaFactory factory;
- IMetadataReader reader;
+ IMetadataReader reader = null;
try{
factory = new MultimediaFactory();
@@ -154,15 +154,17 @@ namespace LongoMatch.Video.Utils
}
height = (int) reader.GetMetadata(GstMetadataType.DimensionY);
width = (int) reader.GetMetadata (GstMetadataType.DimensionX);
- reader.Close();
- reader.Dispose();
-
+
return new MediaFile(filePath,duration*1000,(ushort)fps,hasAudio,hasVideo,videoCodec,audioCodec,(uint)height,(uint)width);
}
catch (GLib.GException ex){
throw new Exception (Catalog.GetString("Invalid video file:")+"\n"+ex.Message);
}
+ finally {
+ reader.Close();
+ reader.Dispose();
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]