gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r10597: Don't leak gstreamer codec s


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10597: Don't leak gstreamer codec strings. Add more codec information for gst
Date: Thu, 19 Feb 2009 14:25:08 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10597
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2009-02-19 14:25:08 +0100
message:
  Don't leak gstreamer codec strings. Add more codec information for gst
  audio decoder.
modified:
  libmedia/gst/AudioDecoderGst.cpp
  libmedia/gst/VideoDecoderGst.cpp
=== modified file 'libmedia/gst/AudioDecoderGst.cpp'
--- a/libmedia/gst/AudioDecoderGst.cpp  2008-10-29 22:32:10 +0000
+++ b/libmedia/gst/AudioDecoderGst.cpp  2009-02-19 13:25:08 +0000
@@ -164,15 +164,23 @@
 
     bool success = GstUtil::check_missing_plugins(srccaps);
     if (!success) {
+        GstStructure* sct = gst_caps_get_structure(srccaps, 0);
+        std::string type(gst_structure_get_name(sct));
+        std::string msg = (boost::format(_("Couldn't find a plugin for "
+                    "audio type %s!")) % type).str();
+
         gst_caps_unref(srccaps);
-       /// @todo print *which* codec 
-        throw MediaException(_("AudioDecoderGst: couldn't find a plugin for 
audio type ..."));
+
+        throw MediaException(msg);
     }
 
 
-    GstCaps* sinkcaps = gst_caps_from_string ("audio/x-raw-int, 
endianness=byte_order, signed=(boolean)true, width=16, depth=16, rate=44100, 
channels=2");
+    GstCaps* sinkcaps = gst_caps_from_string ("audio/x-raw-int, "
+            "endianness=byte_order, signed=(boolean)true, width=16, "
+            "depth=16, rate=44100, channels=2");
     if (!sinkcaps) {
-        throw MediaException(_("AudioDecoderGst: internal error (caps creation 
failed)"));      
+        throw MediaException(_("AudioDecoderGst: internal error "
+                    "(caps creation failed)"));      
     }
 
     std::string resampler = findResampler();

=== modified file 'libmedia/gst/VideoDecoderGst.cpp'
--- a/libmedia/gst/VideoDecoderGst.cpp  2009-02-11 13:09:14 +0000
+++ b/libmedia/gst/VideoDecoderGst.cpp  2009-02-19 13:25:08 +0000
@@ -124,8 +124,8 @@
 
     bool success = GstUtil::check_missing_plugins(srccaps);
     if (!success) {
-        std::string type(gst_caps_to_string(srccaps));
-        type = type.substr(0, type.find(','));
+        GstStructure* sct = gst_caps_get_structure(srccaps, 0);
+        std::string type(gst_structure_get_name(sct));
         std::string msg = (boost::format(_("Couldn't find a plugin for "
                     "video type %s!")) % type).str();
 
@@ -133,6 +133,8 @@
             msg += _(" Please make sure you have gstreamer-ffmpeg installed.");
         }
 
+        gst_caps_unref(srccaps);
+
         throw MediaException(msg);
     }
 
@@ -161,7 +163,8 @@
 {
     GstBuffer* buffer;
     
-    EncodedExtraGstData* extradata = 
dynamic_cast<EncodedExtraGstData*>(frame.extradata.get());
+    EncodedExtraGstData* extradata = 
+        dynamic_cast<EncodedExtraGstData*>(frame.extradata.get());
     
     if (extradata) {
         buffer = extradata->buffer;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]