[rygel] media-export: Don't crash on file without streams
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Don't crash on file without streams
- Date: Sat, 16 Apr 2011 14:50:44 +0000 (UTC)
commit 2ca4b473aa0d5d3d558c60964f352954514e9841
Author: Jens Georg <mail jensge org>
Date: Fri Apr 15 23:27:00 2011 +0300
media-export: Don't crash on file without streams
.../media-export/rygel-media-export-item.vala | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-item.vala b/src/plugins/media-export/rygel-media-export-item.vala
index fb5aad8..944a8c2 100644
--- a/src/plugins/media-export/rygel-media-export-item.vala
+++ b/src/plugins/media-export/rygel-media-export-item.vala
@@ -66,6 +66,14 @@ namespace Rygel.MediaExport.ItemFactory {
audio_streams = dlna_info.info.get_audio_streams ();
video_streams = dlna_info.info.get_video_streams ();
+ if (audio_streams == null && video_streams == null) {
+ debug ("%s had neither audio nor video/picture " +
+ "streams. Ignoring.",
+ file.get_uri ());
+
+ return null;
+ }
+
if (audio_streams == null && video_streams.data.is_image()) {
item = new PhotoItem (id, parent, "");
return fill_photo_item (item as PhotoItem,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]