[transmageddon: 1/5] transmageddon: Avoid exceptions when adding audio info



commit 9293c5035241bbf44a27ad269137cd283b950fe0
Author: Thiago Santos <thiago sousa santos collabora co uk>
Date:   Sat Jul 30 14:39:31 2011 -0300

    transmageddon: Avoid exceptions when adding audio info
    
    Check if the file has audio before trying to fetch the audio
    information to prevent exceptions

 src/transmageddon.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/transmageddon.py b/src/transmageddon.py
index 2b30c63..a9bccac 100644
--- a/src/transmageddon.py
+++ b/src/transmageddon.py
@@ -594,9 +594,10 @@ class TransmageddonUI:
                self.check_for_passthrough(self.container)
        # set markup
 
-       self.audioinformation.set_markup(''.join(('<small>', \
+       if audiostreamcounter >= 0:
+           self.audioinformation.set_markup(''.join(('<small>', \
                        'Audio channels: ', str(audiochannels[0]), '</small>')))
-       self.audiocodec.set_markup(''.join(('<small>','Audio codec: ', \
+           self.audiocodec.set_markup(''.join(('<small>','Audio codec: ', \
                        str(gst.pbutils.get_codec_description(inputaudiocaps[audiostreamcounter])), \
                        '</small>')))
        self.videoinformation.set_markup(''.join(('<small>', 'Video width&#47;height: ', str(videowidth),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]