[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderGst.cp... [relea
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderGst.cp... [release-0-8-0] |
Date: |
Fri, 08 Jun 2007 21:12:48 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch: release-0-8-0
Changes by: Sandro Santilli <strk> 07/06/08 21:12:48
Modified files:
. : ChangeLog
libbase : embedVideoDecoderGst.cpp embedVideoDecoderGst.h
Log message:
* libbase/embedVideoDecoderGst.{cpp,h}: Store decodedFrame
in an auto_ptr to avoid leaks. Fix the case in which
there's NO decoded frame (ie: no gst-ffmpeg installed)
previously segfaulting by simply running
Video-EmbedSquareTestRunner.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.3451.2.50&r2=1.3451.2.51
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderGst.cpp?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.4.4.2&r2=1.4.4.3
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/embedVideoDecoderGst.h?cvsroot=gnash&only_with_tag=release-0-8-0&r1=1.2.4.1&r2=1.2.4.2
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3451.2.50
retrieving revision 1.3451.2.51
diff -u -b -r1.3451.2.50 -r1.3451.2.51
--- ChangeLog 8 Jun 2007 18:12:23 -0000 1.3451.2.50
+++ ChangeLog 8 Jun 2007 21:12:46 -0000 1.3451.2.51
@@ -1,3 +1,11 @@
+2007-06-08 Sandro Santilli <address@hidden>
+
+ * libbase/embedVideoDecoderGst.{cpp,h}: Store decodedFrame
+ in an auto_ptr to avoid leaks. Fix the case in which
+ there's NO decoded frame (ie: no gst-ffmpeg installed)
+ previously segfaulting by simply running
+ Video-EmbedSquareTestRunner.
+
2007-06-08 Tomas Groth Christensen <address@hidden>
* backend/sound_handler_sdl.cpp: Fixed an assertion fault
Index: libbase/embedVideoDecoderGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderGst.cpp,v
retrieving revision 1.4.4.2
retrieving revision 1.4.4.3
diff -u -b -r1.4.4.2 -r1.4.4.3
--- libbase/embedVideoDecoderGst.cpp 7 Jun 2007 12:12:36 -0000 1.4.4.2
+++ libbase/embedVideoDecoderGst.cpp 8 Jun 2007 21:12:47 -0000 1.4.4.3
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-// $Id: embedVideoDecoderGst.cpp,v 1.4.4.2 2007/06/07 12:12:36 tgc Exp $
+// $Id: embedVideoDecoderGst.cpp,v 1.4.4.3 2007/06/08 21:12:47 strk Exp $
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -43,7 +43,6 @@
embedVideoDecoderGst::~embedVideoDecoderGst()
{
- delete decodedFrame;
if (pipeline) {
stop = true;
@@ -161,9 +160,9 @@
// Determine required buffer size and allocate buffer
if (outputFormat == YUV) {
- decodedFrame = new image::yuv(width, height);
+ decodedFrame.reset(new image::yuv(width, height));
} else if (outputFormat == RGB) {
- decodedFrame = new image::rgb(width, height);
+ decodedFrame.reset(new image::rgb(width, height));
}
// Start "playing"
@@ -189,7 +188,15 @@
// If there is nothing to decode in the new frame
// we just return the lastest.
- if (data == NULL || size == 0 || !decoder) {
+ if (data == NULL || size == 0 || !decoder)
+ {
+ // If we never decoded any frame return a NULL
+ // auto pointer ..
+ if ( ! decodedFrame.get() )
+ {
+ ret_image.reset(NULL);
+ return ret_image;
+ }
ret_image->update(decodedFrame->m_data);
return ret_image;
}
@@ -201,6 +208,13 @@
output_lock = new boost::mutex::scoped_lock(output_mutex);
+ // If we never decoded any frame return a NULL
+ // auto pointer ..
+ if ( ! decodedFrame.get() )
+ {
+ ret_image.reset(NULL);
+ return ret_image;
+ }
ret_image->update(decodedFrame->m_data);
return ret_image;
@@ -229,7 +243,8 @@
if (decoder->stop) return;
- if (decoder->decodedFrame) {
+ if (decoder->decodedFrame.get())
+ {
if (decoder->outputFormat == YUV) {
assert(0);
Index: libbase/embedVideoDecoderGst.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/embedVideoDecoderGst.h,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -u -b -r1.2.4.1 -r1.2.4.2
--- libbase/embedVideoDecoderGst.h 6 Jun 2007 15:44:13 -0000 1.2.4.1
+++ libbase/embedVideoDecoderGst.h 8 Jun 2007 21:12:47 -0000 1.2.4.2
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-// $Id: embedVideoDecoderGst.h,v 1.2.4.1 2007/06/06 15:44:13 tgc Exp $
+// $Id: embedVideoDecoderGst.h,v 1.2.4.2 2007/06/08 21:12:47 strk Exp $
#ifndef __EMBEDVIDEODECODERGST_H__
#define __EMBEDVIDEODECODERGST_H__
@@ -90,7 +90,7 @@
int frameSize;
/// Last decoded frame
- image::image_base* decodedFrame;
+ std::auto_ptr<image::image_base> decodedFrame;
/// If we should stop this will be true
volatile bool stop;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog libbase/embedVideoDecoderGst.cp... [release-0-8-0],
Sandro Santilli <=