[gnash] 02/05: Imported Upstream version 0.8.11~git20150419
Gabriele Giacone
gg0-guest at moszumanska.debian.org
Sun Apr 19 22:13:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
gg0-guest pushed a commit to branch master
in repository gnash.
commit 9550b948b37fc69980c801dfe556b7734eb18b28
Author: Gabriele Giacone <1o5g4r8o at gmail.com>
Date: Sun Apr 19 15:24:25 2015 +0200
Imported Upstream version 0.8.11~git20150419
---
Makefile.am | 1 +
NEWS | 3 +-
configure.ac | 49 ++++++++++++++--------
gui/fb/fb.am | 4 ++
gui/gtk/gtk_canvas.cpp | 4 --
libbase/GnashImageGif.cpp | 6 ++-
libbase/GnashImageJpeg.cpp | 8 ++--
libcore/DragState.h | 2 +-
libcore/LoadVariablesThread.cpp | 25 +++++-------
libcore/LoadVariablesThread.h | 24 ++++++-----
libcore/SWFStream.cpp | 2 +-
libcore/as_value.h | 13 +++---
libcore/swf/SetTabIndexTag.cpp | 1 +
libdevice/vaapi/VaapiContext.h | 2 +-
libdevice/vaapi/VaapiGlobalContext.cpp | 4 +-
libmedia/ffmpeg/AudioDecoderFfmpeg.cpp | 34 +---------------
libmedia/ffmpeg/MediaParserFfmpeg.cpp | 19 ++++-----
libmedia/ffmpeg/VideoDecoderFfmpeg.cpp | 35 ++++++----------
libmedia/ffmpeg/ffmpegHeaders.h | 14 +++++++
librender/cairo/Renderer_cairo.cpp | 2 -
macros/ax_append_compile_flags.m4 | 65 +++++++++++++++++++++++++++++
macros/ax_append_flag.m4 | 71 ++++++++++++++++++++++++++++++++
macros/ax_append_link_flags.m4 | 63 +++++++++++++++++++++++++++++
macros/ax_check_compile_flag.m4 | 74 ++++++++++++++++++++++++++++++++++
macros/ax_check_link_flag.m4 | 74 ++++++++++++++++++++++++++++++++++
macros/ax_require_defined.m4 | 37 +++++++++++++++++
macros/boost.m4 | 18 +--------
macros/ffmpeg.m4 | 3 +-
macros/qt4.m4 | 4 +-
revno.h | 2 +-
testsuite/analyse-results.sh | 23 +++++------
testsuite/misc-ming.all/Makefile.am | 1 -
testsuite/network.all/Makefile.am | 1 -
testsuite/timingissues | 10 ++---
34 files changed, 528 insertions(+), 170 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 1199d32..da605cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -230,6 +230,7 @@ dumpconfig:
@uname -a
$(CXX) -v
@echo "CXXFLAGS: $(CXXFLAGS)"
+ @echo "CFLAGS: $(CFLAGS)"
@echo "LDFLAGS: $(LDFLAGS)"
@echo ""
@echo "Image decoding support..."
diff --git a/NEWS b/NEWS
index dc3d70a..1ae2c00 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ Caveats:
Improvements since 0.8.10 release are:
+ * Fix possible out-of-bound read in parser (#43865)
* Fix opening of external URL with Gnash Standalone (#31833)
* Stability fixes in image handling, (CVE-2012-1175, #39388, #37629).
* Stability fixes in parsing (#34686) and ActionScript handling (#39385,
@@ -19,7 +20,7 @@ Improvements since 0.8.10 release are:
* Improved NetStream ActionScript class support.
* Add support for IPv6 [TODO: affects Socket/XML, and what else?].
* Fix build against recent Boost, FFMPEG and libav.
- * Fix support for GIFLIB-5.0 (#39482)
+ * Fix support for GIFLIB-5.0 (#39482) and GIFLIB-5.1 (#42574)
* Fix regression in dynamic sound loading (#33760).
* Fix infinite loop in GC mark phase for XML object (#40440)
* Fix segfault on exit when using XML (#40439)
diff --git a/configure.ac b/configure.ac
index 10e7b49..c47280d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,7 +248,7 @@ AC_ARG_WITH(sysroot,
with_top_level=${withval};
cross_compiling=yes)
-if test x"${cross_compiling}" != x; then
+if test x"${cross_compiling}" = xyes; then
dnl Check if /usr isn't part of the specified path
if test -d ${with_top_level}/usr; then
with_top_level=${withval}/usr
@@ -2897,18 +2897,23 @@ AC_ARG_ENABLE([harden],
[harden=yes]
)
-if test x"$harden" = x"yes" -a x"${host_cpu}" != x"mips" -a x"${android}" != x"yes" -a x"$GCC" = x"yes"; then
- CPPFLAGS="${CPPFLAGS} -D_FORTIFY_SOURCE=2"
- CFLAGS="${CFLAGS} -fPIE -fstack-protector --param ssp-buffer-size=4 -Wformat -Werror=format-security"
- CXXFLAGS="${CXXFLAGS} -fPIE -fstack-protector --param ssp-buffer-size=4 -Wformat -Werror=format-security"
+AC_DEFUN([ADD_HARDENING_FLAGS],[
+ AX_APPEND_COMPILE_FLAGS([-fpie -fPIE -Wformat -Werror=format-security])
- if test x"$with_gnu_ld" = x"yes"; then
- LDFLAGS="${LDFLAGS} -fPIE -pie -Wl,-z,relro -Wl,-z,now"
- elif test x"$darwin" = x"yes"; then
- LDFLAGS="${LDFLAGS} -fPIE -pie"
- else
- LDFLAGS="${LDFLAGS}"
- fi
+ AX_CHECK_COMPILE_FLAG([-fstack-protector-strong],
+ [AX_APPEND_FLAG([-fstack-protector-strong])],
+ [AX_APPEND_COMPILE_FLAGS(["-fstack-protector --param ssp-buffer-size=4"])])
+])
+
+if test x"$harden" = x"yes"; then
+ CPPFLAGS="${CPPFLAGS} -D_FORTIFY_SOURCE=2"
+
+ ADD_HARDENING_FLAGS
+ AC_LANG_PUSH(C++)
+ ADD_HARDENING_FLAGS
+ AC_LANG_POP(C++)
+
+ AX_APPEND_LINK_FLAGS([-fPIE -pie -Wl,-z,relro -Wl,-z,now])
fi
dnl Define convenience constants so Gnash can print out the
@@ -2926,8 +2931,8 @@ AC_SUBST(HWACCEL_CONFIG)
dnl check for missing libraries and disable them.
if test x"$BOOST_LIBS" != x; then
- if test x"${cygnal_missing_libs}" != x; then
- for i in ${cygnal_missing_libs}; do
+ if test x"${missing_cygnal_libs}" != x; then
+ for i in ${missing_cygnal_libs}; do
if test $i = serialization; then
AC_DEFINE([BOOST_MULTI_INDEX_DISABLE_SERIALIZATION], ["1"], [if the library is missing, don't use it.])
fi
@@ -3819,8 +3824,8 @@ if test x"$BOOST_LIBS" != x; then
fi
if test x"${cygnal}" = x"yes"; then
- if test x"${cygnal_missing_libs}" != x; then
- for i in ${cygnal_missing_libs}; do
+ if test x"${missing_cygnal_libs}" != x; then
+ for i in ${missing_cygnal_libs}; do
PKG_ERR([No Boost $i package installed])
PKG_SUGGEST([Install it from http://www.boost.org])
debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
@@ -3830,6 +3835,18 @@ if test x"$BOOST_LIBS" != x; then
fi
fi
+ if test x"${npapi}" = x"yes"; then
+ if test x"${missing_plugin_libs}" != x; then
+ for i in ${missing_plugin_libs}; do
+ PKG_ERR([No Boost $i package installed])
+ PKG_SUGGEST([Install it from http://www.boost.org])
+ debtmppkg="libboost-`echo ${i} | sed 's/_/-/g'`-dev"
+ DEB_INSTALL([$debtmppkg])
+ PKG_ALTERNATIVE([or configure with --disable-npapi])
+ done
+ fi
+ fi
+
if test x"${missing_libs}" != x; then
for i in ${missing_libs}; do
PKG_ERR([No Boost $i package installed])
diff --git a/gui/fb/fb.am b/gui/fb/fb.am
index 2182f1b..cccdd0c 100644
--- a/gui/fb/fb.am
+++ b/gui/fb/fb.am
@@ -62,6 +62,10 @@ fb_gnash_CPPFLAGS += \
fb_gnash_LDADD += $(GLES1_LIBS) $(EGL_LIBS)
endif # BUILD_OVG_RENDERER
+if BUILD_EGL_DEVICE
+fb_gnash_LDADD += $(EGL_LIBS)
+endif # BUILD_EGL_DEVICE
+
if ANDROID
fb_gnash_LDADD += -lui -llog
endif # ANDROID
diff --git a/gui/gtk/gtk_canvas.cpp b/gui/gtk/gtk_canvas.cpp
index b834c39..45c7cd6 100644
--- a/gui/gtk/gtk_canvas.cpp
+++ b/gui/gtk/gtk_canvas.cpp
@@ -76,10 +76,6 @@ static gboolean gnash_canvas_configure_event(GtkWidget *widget, GdkEventConfigur
static void gnash_canvas_realize(GtkWidget *widget);
static void gnash_canvas_after_realize(GtkWidget *widget);
-namespace {
- gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
-}
-
GtkWidget *
gnash_canvas_new ()
{
diff --git a/libbase/GnashImageGif.cpp b/libbase/GnashImageGif.cpp
index 84b09ce..2ae5ddb 100644
--- a/libbase/GnashImageGif.cpp
+++ b/libbase/GnashImageGif.cpp
@@ -120,7 +120,11 @@ GifInput::GifInput(std::shared_ptr<IOChannel> in)
GifInput::~GifInput()
{
// Clean up allocated data.
- DGifCloseFile(_gif);
+#if GIFLIB_MAJOR==5 && GIFLIB_MINOR==1
+ DGifCloseFile(_gif, 0);
+#else
+ DGifCloseFile(_gif);
+#endif
}
size_t
diff --git a/libbase/GnashImageJpeg.cpp b/libbase/GnashImageJpeg.cpp
index f3365f5..bfe34b3 100644
--- a/libbase/GnashImageJpeg.cpp
+++ b/libbase/GnashImageJpeg.cpp
@@ -113,7 +113,7 @@ public:
if (src->m_start_of_file) {
// Treat this as a fatal error.
log_error(_("JPEG: Empty jpeg source stream."));
- return false;
+ return FALSE;
}
// Insert a fake EOI marker.
@@ -139,7 +139,7 @@ public:
src->m_pub.bytes_in_buffer = bytes_read;
src->m_start_of_file = false;
- return true;
+ return TRUE;
}
// Called by client when it wants to advance past some
@@ -517,13 +517,13 @@ public:
!= IO_BUF_SIZE) {
// Error.
log_error(_("rw_dest_IOChannel couldn't write data."));
- return false;
+ return FALSE;
}
dest->m_pub.next_output_byte = dest->m_buffer;
dest->m_pub.free_in_buffer = IO_BUF_SIZE;
- return true;
+ return TRUE;
}
/// Terminate the destination.
diff --git a/libcore/DragState.h b/libcore/DragState.h
index 37c333d..f44330f 100644
--- a/libcore/DragState.h
+++ b/libcore/DragState.h
@@ -62,7 +62,7 @@ public:
std::int32_t yOffset() const { return _yoffset; }
bool hasBounds() const {
- return (_bounds);
+ return _bounds ? true : false;
}
/// \brief
diff --git a/libcore/LoadVariablesThread.cpp b/libcore/LoadVariablesThread.cpp
index 2b1ef3a..eb964fe 100644
--- a/libcore/LoadVariablesThread.cpp
+++ b/libcore/LoadVariablesThread.cpp
@@ -32,10 +32,9 @@ namespace gnash {
// static
LoadVariablesThread::ValuesMap
-LoadVariablesThread::completeLoad(IOChannel* varstream,
- std::atomic<bool>& canceled)
+LoadVariablesThread::completeLoad(std::unique_ptr<IOChannel> stream,
+ const std::atomic<int8_t>& status)
{
- std::unique_ptr<IOChannel> stream(varstream);
#ifdef DEBUG_LOAD_VARIABLES
log_debug("completeLoad called");
#endif
@@ -100,7 +99,7 @@ LoadVariablesThread::completeLoad(IOChannel* varstream,
break;
}
- if ( canceled.load() ) {
+ if ( static_cast<Status>(status.load()) == Status::CANCEL_REQUESTED ) {
log_debug("Cancelling LoadVariables download thread...");
stream.reset();
return parseResult;
@@ -125,21 +124,18 @@ LoadVariablesThread::completeLoad(IOChannel* varstream,
}
//dispatchLoadEvent();
- canceled = true;
return parseResult;
}
LoadVariablesThread::LoadVariablesThread(const StreamProvider& sp,
const URL& url, const std::string& postdata)
- : _canceled(false)
{
startThread(sp.getStream(url, postdata));
}
LoadVariablesThread::LoadVariablesThread(const StreamProvider& sp,
const URL& url)
- : _canceled(false)
{
startThread(sp.getStream(url));
}
@@ -151,17 +147,18 @@ LoadVariablesThread::startThread(std::unique_ptr<IOChannel> stream)
throw NetworkException();
}
- // Passing IOStream* rather than unique_ptr serves to appease GCC 4.6,
- // which insists the arguments are CopyConstructible rather than Movable.
- _vals = std::async(std::launch::async, completeLoad, stream.release(),
- std::ref(_canceled));
+ _thread = std::thread(
+ [&] (IOChannel* varstream) {
+ _vals = completeLoad(std::unique_ptr<IOChannel>(varstream), _status);
+ _status = static_cast<int8_t>(Status::FINISHED);
+ }, stream.release());
}
LoadVariablesThread::~LoadVariablesThread()
{
- if ( _vals.valid() ) {
- _canceled = true;
- _vals.wait();
+ if (_thread.joinable()) {
+ _status = static_cast<int8_t>(Status::CANCEL_REQUESTED);
+ _thread.join();
}
}
diff --git a/libcore/LoadVariablesThread.h b/libcore/LoadVariablesThread.h
index 0be3985..341a5f4 100644
--- a/libcore/LoadVariablesThread.h
+++ b/libcore/LoadVariablesThread.h
@@ -23,9 +23,10 @@
#include <string>
#include <map>
-#include <future>
#include <atomic>
-
+#include <cassert>
+#include <memory>
+#include <thread>
namespace gnash {
class StreamProvider;
@@ -49,6 +50,8 @@ class LoadVariablesThread
public:
typedef std::map<std::string, std::string> ValuesMap;
+ enum class Status : std::int8_t { STARTED = 0, FINISHED, CANCEL_REQUESTED };
+
/// Construct a LoadVariablesThread opening a stream for the given URL
//
/// Throws a NetworkException if unable.
@@ -79,12 +82,13 @@ public:
/// Return the name,value map parsed out of the loaded stream
ValuesMap getValues()
{
- return _vals.get();
+ assert(completed());
+ return _vals;
}
bool completed()
{
- return _canceled;
+ return static_cast<Status>(_status.load()) == Status::FINISHED;
}
private:
@@ -99,15 +103,13 @@ private:
//
/// This function should be run by a separate thread.
///
- static ValuesMap completeLoad(IOChannel* stream,
- std::atomic<bool>& canceled);
+ static ValuesMap completeLoad(std::unique_ptr<IOChannel> stream,
+ const std::atomic<int8_t>& status);
- std::future<ValuesMap> _vals;
+ ValuesMap _vals;
- /// Indicates either whether cancellation was requested, or whether the
- /// thread has finished executing code, from the perspective of the
- /// variables loading thread thread and the main thread respectively.
- std::atomic<bool> _canceled;
+ std::thread _thread;
+ std::atomic<int8_t> _status; // enum class Status; int for compatibility.
};
} // namespace gnash
diff --git a/libcore/SWFStream.cpp b/libcore/SWFStream.cpp
index 6001bf7..3c215c9 100644
--- a/libcore/SWFStream.cpp
+++ b/libcore/SWFStream.cpp
@@ -132,7 +132,7 @@ unsigned SWFStream::read_uint(unsigned short bitcount)
//std::cerr << "BytesToRead: " << bytesToRead << " spareBits: " << spareBits << " unusedBits: " << (int)m_unused_bits << std::endl;
assert (bytesToRead <= 4);
- byte cache[4]; // at most 4 bytes in the cache
+ byte cache[5]; // at most 4 bytes in the cache + eventual spare bits
if ( spareBits ) m_input->read(&cache, bytesToRead+1);
else m_input->read(&cache, bytesToRead);
diff --git a/libcore/as_value.h b/libcore/as_value.h
index 22ac59a..1bf3c0a 100644
--- a/libcore/as_value.h
+++ b/libcore/as_value.h
@@ -26,7 +26,6 @@
#include <type_traits>
#include <cstdint>
-#include "utility.h" // for UNUSED
#include "dsodefs.h" // for DSOTEXPORT
#include "CharacterProxy.h"
#include "GnashNumeric.h" // for isNaN
@@ -157,16 +156,14 @@ public:
{}
/// Construct a primitive Boolean value
- template <typename T>
- as_value(T val, typename std::enable_if<std::is_same<bool, T>::value>::type*
- dummy = 0)
+ template <typename T, typename U =
+ typename std::enable_if<std::is_same<bool, T>::value>::type>
+ as_value(T val)
:
_type(BOOLEAN),
_value(val)
- {
- UNUSED(dummy);
- }
-
+ {}
+
/// Construct a primitive Number value
as_value(double num)
:
diff --git a/libcore/swf/SetTabIndexTag.cpp b/libcore/swf/SetTabIndexTag.cpp
index fda4f34..b2f5a30 100644
--- a/libcore/swf/SetTabIndexTag.cpp
+++ b/libcore/swf/SetTabIndexTag.cpp
@@ -24,6 +24,7 @@
#include "MovieClip.h"
#include "GnashNumeric.h"
#include "RunResources.h"
+#include "utility.h" // UNUSED
namespace gnash {
namespace SWF {
diff --git a/libdevice/vaapi/VaapiContext.h b/libdevice/vaapi/VaapiContext.h
index 8d9de72..c49d48a 100644
--- a/libdevice/vaapi/VaapiContext.h
+++ b/libdevice/vaapi/VaapiContext.h
@@ -84,7 +84,7 @@ public:
void releaseSurface(std::shared_ptr<VaapiSurface> surface);
/// Set user data
- void setData(std::unique_ptr<VaapiContextData> user_data) { _user_data = user_data; }
+ void setData(std::unique_ptr<VaapiContextData> user_data) { _user_data = std::move(user_data); }
/// Get user data
VaapiContextData *getData() const { return _user_data.get(); }
diff --git a/libdevice/vaapi/VaapiGlobalContext.cpp b/libdevice/vaapi/VaapiGlobalContext.cpp
index c19ed07..5127a27 100644
--- a/libdevice/vaapi/VaapiGlobalContext.cpp
+++ b/libdevice/vaapi/VaapiGlobalContext.cpp
@@ -33,7 +33,7 @@
namespace gnash {
VaapiGlobalContext::VaapiGlobalContext(std::unique_ptr<VaapiDisplay> display)
- : _display(display)
+ : _display(std::move(display))
{
GNASH_REPORT_FUNCTION;
@@ -145,7 +145,7 @@ VaapiGlobalContext *VaapiGlobalContext::get()
if (!dpy.get()) {
return NULL;
}
- vaapi_global_context.reset(new VaapiGlobalContext(dpy));
+ vaapi_global_context.reset(new VaapiGlobalContext(std::move(dpy)));
}
catch (...) {
vaapi_set_is_enabled(false);
diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index 56b5248..c98e2d8 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -78,10 +78,6 @@ AudioDecoderFfmpeg::~AudioDecoderFfmpeg()
void AudioDecoderFfmpeg::setup(SoundInfo& info)
{
-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52,6,2)
- // Starting from this version avcodec_register calls avcodec_init
- avcodec_init();
-#endif
avcodec_register_all();// change this to only register need codec?
enum CODECID codec_id;
@@ -127,20 +123,12 @@ void AudioDecoderFfmpeg::setup(SoundInfo& info)
}
}
-#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53,8,0)
_audioCodecCtx = avcodec_alloc_context3(_audioCodec);
-#else
- _audioCodecCtx = avcodec_alloc_context();
-#endif
if (!_audioCodecCtx) {
throw MediaException(_("libavcodec couldn't allocate context"));
}
-#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53,8,0)
int ret = avcodec_open2(_audioCodecCtx, _audioCodec, nullptr);
-#else
- int ret = avcodec_open(_audioCodecCtx, _audioCodec);
-#endif
if (ret < 0) {
av_free(_audioCodecCtx);
_audioCodecCtx=nullptr;
@@ -177,10 +165,6 @@ void AudioDecoderFfmpeg::setup(SoundInfo& info)
void AudioDecoderFfmpeg::setup(const AudioInfo& info)
{
// Init the avdecoder-decoder
-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52,6,2)
- // Starting from this version avcodec_register calls avcodec_init
- avcodec_init();
-#endif
avcodec_register_all();// change this to only register need codec?
enum CODECID codec_id = AV_CODEC_ID_NONE;
@@ -261,11 +245,7 @@ void AudioDecoderFfmpeg::setup(const AudioInfo& info)
_needsParsing = (_parser != nullptr);
// Create an audioCodecCtx from the ffmpeg parser if exists/possible
-#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53,8,0)
_audioCodecCtx = avcodec_alloc_context3(_audioCodec);
-#else
- _audioCodecCtx = avcodec_alloc_context();
-#endif
if (!_audioCodecCtx) {
throw MediaException(_("AudioDecoderFfmpeg: libavcodec couldn't "
"allocate context"));
@@ -316,11 +296,7 @@ void AudioDecoderFfmpeg::setup(const AudioInfo& info)
#ifdef GNASH_DEBUG_AUDIO_DECODING
log_debug(" Opening codec");
#endif // GNASH_DEBUG_AUDIO_DECODING
-#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53,8,0)
int ret = avcodec_open2(_audioCodecCtx, _audioCodec, nullptr);
-#else
- int ret = avcodec_open(_audioCodecCtx, _audioCodec);
-#endif
if (ret < 0) {
//avcodec_close(_audioCodecCtx);
av_free(_audioCodecCtx);
@@ -500,7 +476,7 @@ AudioDecoderFfmpeg::decodeFrame(const std::uint8_t* input,
av_init_packet(&pkt);
pkt.data = const_cast<uint8_t*>(input);
pkt.size = inputSize;
- std::unique_ptr<AVFrame, decltype(av_free)*> frm ( FRAMEALLOC(), av_free );
+ std::unique_ptr<AVFrame, FrameDeleter> frm(FRAMEALLOC(), FrameDeleter());
if (!frm.get()) {
log_error(_("failed to allocate frame."));
return nullptr;
@@ -634,21 +610,13 @@ AudioDecoderFfmpeg::parseInput(const std::uint8_t* input,
{
if ( _needsParsing )
{
-#if LIBAVCODEC_VERSION_MAJOR >= 53
return av_parser_parse2(_parser, _audioCodecCtx,
-#else
- return av_parser_parse(_parser, _audioCodecCtx,
-#endif
// as of 2008-10-28 SVN, ffmpeg doesn't
// accept a pointer to pointer to const..
const_cast<std::uint8_t**>(outFrame),
outFrameSize,
input, inputSize,
-#if LIBAVCODEC_VERSION_MAJOR >= 53
0, 0, AV_NOPTS_VALUE); // pts, dts, pos
-#else
- 0, 0); // pts & dts
-#endif
}
else
{
diff --git a/libmedia/ffmpeg/MediaParserFfmpeg.cpp b/libmedia/ffmpeg/MediaParserFfmpeg.cpp
index 634254e..2c64eed 100644
--- a/libmedia/ffmpeg/MediaParserFfmpeg.cpp
+++ b/libmedia/ffmpeg/MediaParserFfmpeg.cpp
@@ -86,7 +86,10 @@ MediaParserFfmpeg::probeStream()
probe_data.filename = "";
probe_data.buf = buffer.get();
probe_data.buf_size = actuallyRead;
-
+#if LIBAVFORMAT_VERSION_MAJOR > 55
+ probe_data.mime_type = nullptr;
+#endif
+
AVInputFormat* ret = av_probe_input_format(&probe_data, 1);
return ret;
}
@@ -168,10 +171,9 @@ MediaParserFfmpeg::parseVideoFrame(AVPacket& packet)
// flags, for keyframe
//bool isKeyFrame = packet.flags&PKT_FLAG_KEY;
- // TODO: FIXME: *2 is an hack to avoid libavcodec reading past end of allocated space
- // we might do proper padding or (better) avoid the copy as a whole by making
- // EncodedVideoFrame virtual.
- size_t allocSize = packet.size*2;
+ // TODO: We might avoid the copy as a whole by making EncodedVideoFrame
+ // virtual.
+ size_t allocSize = packet.size + FF_INPUT_BUFFER_PADDING_SIZE;
std::uint8_t* data = new std::uint8_t[allocSize];
std::copy(packet.data, packet.data+packet.size, data);
std::unique_ptr<EncodedVideoFrame> frame(new EncodedVideoFrame(data, packet.size, 0, timestamp));
@@ -217,10 +219,9 @@ MediaParserFfmpeg::parseAudioFrame(AVPacket& packet)
std::unique_ptr<EncodedAudioFrame> frame ( new EncodedAudioFrame );
- // TODO: FIXME: *2 is an hack to avoid libavcodec reading past end of allocated space
- // we might do proper padding or (better) avoid the copy as a whole by making
- // EncodedVideoFrame virtual.
- size_t allocSize = packet.size*2;
+ // TODO: We might avoid the copy as a whole by making EncodedAudioFrame
+ // virtual.
+ size_t allocSize = packet.size + FF_INPUT_BUFFER_PADDING_SIZE;
std::uint8_t* data = new std::uint8_t[allocSize];
std::copy(packet.data, packet.data+packet.size, data);
diff --git a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
index 81256ec..20d49b9 100644
--- a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
@@ -186,11 +186,7 @@ VideoDecoderFfmpeg::init(enum CODECID codecId, int /*width*/, int /*height*/,
throw MediaException(_("libavcodec can't decode this video format"));
}
-#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53,8,0)
_videoCodecCtx.reset(new CodecContextWrapper(avcodec_alloc_context3(_videoCodec)));
-#else
- _videoCodecCtx.reset(new CodecContextWrapper(avcodec_alloc_context()));
-#endif
if (!_videoCodecCtx->getContext()) {
throw MediaException(_("libavcodec couldn't allocate context"));
}
@@ -217,11 +213,7 @@ VideoDecoderFfmpeg::init(enum CODECID codecId, int /*width*/, int /*height*/,
}
#endif
-#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53,8,0)
int ret = avcodec_open2(ctx, _videoCodec, nullptr);
-#else
- int ret = avcodec_open(ctx, _videoCodec);
-#endif
if (ret < 0) {
boost::format msg = boost::format(_("libavcodec "
"failed to initialize FFMPEG "
@@ -367,36 +359,35 @@ VideoDecoderFfmpeg::decode(const std::uint8_t* input,
std::unique_ptr<image::GnashImage> ret;
- AVFrame* frame = FRAMEALLOC();
+ std::unique_ptr<AVFrame, FrameDeleter> frame(FRAMEALLOC(), FrameDeleter());
if ( ! frame ) {
log_error(_("Out of memory while allocating avcodec frame"));
return ret;
}
- int bytes = 0;
+ int got_frame = 0;
// no idea why avcodec_decode_video wants a non-const input...
-#if LIBAVCODEC_VERSION_MAJOR >= 53
AVPacket pkt;
av_init_packet(&pkt);
pkt.data = const_cast<uint8_t*>(input);
pkt.size = input_size;
- avcodec_decode_video2(_videoCodecCtx->getContext(), frame, &bytes,
- &pkt);
-#else
- avcodec_decode_video(_videoCodecCtx->getContext(), frame, &bytes,
- input, input_size);
-#endif
+ int bytesConsumed = avcodec_decode_video2(_videoCodecCtx->getContext(),
+ frame.get(), &got_frame, &pkt);
- if (!bytes) {
- log_error(_("Decoding of a video frame failed"));
- av_free(frame);
+ if (bytesConsumed < 0) {
+ log_error(_("Decoding of a video frame failed: %1%"), bytesConsumed);
+ return ret;
+ }
+ if (static_cast<std::uint32_t>(bytesConsumed) < input_size) {
+ log_error("only %1% of %2% bytes consumed", bytesConsumed, input_size);
+ }
+ if (!got_frame) {
+ log_debug("Decoding succeeded, but no frame is available yet.");
return ret;
}
ret = frameToImage(_videoCodecCtx->getContext(), *frame);
- // FIXME: av_free doesn't free frame->data!
- av_free(frame);
return ret;
}
diff --git a/libmedia/ffmpeg/ffmpegHeaders.h b/libmedia/ffmpeg/ffmpegHeaders.h
index 0741777..53b5b18 100644
--- a/libmedia/ffmpeg/ffmpegHeaders.h
+++ b/libmedia/ffmpeg/ffmpegHeaders.h
@@ -114,8 +114,22 @@ extern "C" {
#define avg_frame_rate r_frame_rate
#define FRAMEALLOC avcodec_alloc_frame
+struct FrameDeleter
+{
+ void operator()(AVFrame* frame)
+ {
+ av_free(frame);
+ }
+};
#else
#define FRAMEALLOC av_frame_alloc
+struct FrameDeleter
+{
+ void operator()(AVFrame* frame)
+ {
+ av_frame_free(&frame);
+ }
+};
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,18,102)
diff --git a/librender/cairo/Renderer_cairo.cpp b/librender/cairo/Renderer_cairo.cpp
index 656f2a8..d2ef4b3 100644
--- a/librender/cairo/Renderer_cairo.cpp
+++ b/librender/cairo/Renderer_cairo.cpp
@@ -111,7 +111,6 @@ class bitmap_info_cairo : public CachedBitmap, boost::noncopyable
_data(data),
_width(width),
_height(height),
- _bytes_per_pixel(bpp),
_format(format),
_surface(cairo_image_surface_create_for_data(_data.get(),
format, width, height, width * bpp)),
@@ -210,7 +209,6 @@ class bitmap_info_cairo : public CachedBitmap, boost::noncopyable
std::unique_ptr<std::uint8_t[]> _data;
int _width;
int _height;
- size_t _bytes_per_pixel;
cairo_format_t _format;
cairo_surface_t* _surface;
cairo_pattern_t* _pattern;
diff --git a/macros/ax_append_compile_flags.m4 b/macros/ax_append_compile_flags.m4
new file mode 100644
index 0000000..dc7b866
--- /dev/null
+++ b/macros/ax_append_compile_flags.m4
@@ -0,0 +1,65 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+# For every FLAG1, FLAG2 it is checked whether the compiler works with the
+# flag. If it does, the flag is added FLAGS-VARIABLE
+#
+# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+# CFLAGS) is used. During the check the flag is always added to the
+# current language's flags.
+#
+# If EXTRA-FLAGS is defined, it is added to the current language's default
+# flags (e.g. CFLAGS) when the check is done. The check is thus made with
+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
+# force the compiler to issue an error when a bad flag is given.
+#
+# NOTE: This macro depends on the AX_APPEND_FLAG and
+# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
+# AX_APPEND_LINK_FLAGS.
+#
+# LICENSE
+#
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans at gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
+[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
+AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
+for flag in $1; do
+ AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3])
+done
+])dnl AX_APPEND_COMPILE_FLAGS
diff --git a/macros/ax_append_flag.m4 b/macros/ax_append_flag.m4
new file mode 100644
index 0000000..d26286c
--- /dev/null
+++ b/macros/ax_append_flag.m4
@@ -0,0 +1,71 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
+#
+# DESCRIPTION
+#
+# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
+# added in between.
+#
+# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
+# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
+# FLAG.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod at gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans at gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AC_DEFUN([AX_APPEND_FLAG],
+[dnl
+AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
+AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
+AS_VAR_SET_IF(FLAGS,[
+ AS_CASE([AS_VAR_GET(FLAGS)],
+ ["* $1 *|*$1"],[AC_RUN_LOG([: FLAGS already contains $1])],
+ [
+ AS_VAR_APPEND(FLAGS," $1")
+ AC_RUN_LOG([: FLAGS="$FLAGS"])
+ ])
+ ],
+ [
+ AS_VAR_SET(FLAGS,[$1])
+ AC_RUN_LOG([: FLAGS="$FLAGS"])
+ ])
+AS_VAR_POPDEF([FLAGS])dnl
+])dnl AX_APPEND_FLAG
diff --git a/macros/ax_append_link_flags.m4 b/macros/ax_append_link_flags.m4
new file mode 100644
index 0000000..c73ddaf
--- /dev/null
+++ b/macros/ax_append_link_flags.m4
@@ -0,0 +1,63 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
+#
+# DESCRIPTION
+#
+# For every FLAG1, FLAG2 it is checked whether the linker works with the
+# flag. If it does, the flag is added FLAGS-VARIABLE
+#
+# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
+# used. During the check the flag is always added to the linker's flags.
+#
+# If EXTRA-FLAGS is defined, it is added to the linker's default flags
+# when the check is done. The check is thus made with the flags: "LDFLAGS
+# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
+# issue an error when a bad flag is given.
+#
+# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
+# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
+#
+# LICENSE
+#
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans at gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AC_DEFUN([AX_APPEND_LINK_FLAGS],
+[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
+AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
+for flag in $1; do
+ AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3])
+done
+])dnl AX_APPEND_LINK_FLAGS
diff --git a/macros/ax_check_compile_flag.m4 b/macros/ax_check_compile_flag.m4
new file mode 100644
index 0000000..ca36397
--- /dev/null
+++ b/macros/ax_check_compile_flag.m4
@@ -0,0 +1,74 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+# Check whether the given FLAG works with the current language's compiler
+# or gives an error. (Warnings, however, are ignored)
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# If EXTRA-FLAGS is defined, it is added to the current language's default
+# flags (e.g. CFLAGS) when the check is done. The check is thus made with
+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
+# force the compiler to issue an error when a bad flag is given.
+#
+# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod at gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans at gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+ [AS_VAR_SET(CACHEVAR,[yes])],
+ [AS_VAR_SET(CACHEVAR,[no])])
+ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+ [m4_default([$2], :)],
+ [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/macros/ax_check_link_flag.m4 b/macros/ax_check_link_flag.m4
new file mode 100644
index 0000000..eb01a6c
--- /dev/null
+++ b/macros/ax_check_link_flag.m4
@@ -0,0 +1,74 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+# Check whether the given FLAG works with the linker or gives an error.
+# (Warnings, however, are ignored)
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# If EXTRA-FLAGS is defined, it is added to the linker's default flags
+# when the check is done. The check is thus made with the flags: "LDFLAGS
+# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
+# issue an error when a bad flag is given.
+#
+# INPUT gives an alternative input source to AC_LINK_IFELSE.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod at gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans at gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 4
+
+AC_DEFUN([AX_CHECK_LINK_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
+AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
+ ax_check_save_flags=$LDFLAGS
+ LDFLAGS="$LDFLAGS $4 $1"
+ AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+ [AS_VAR_SET(CACHEVAR,[yes])],
+ [AS_VAR_SET(CACHEVAR,[no])])
+ LDFLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+ [m4_default([$2], :)],
+ [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_LINK_FLAGS
diff --git a/macros/ax_require_defined.m4 b/macros/ax_require_defined.m4
new file mode 100644
index 0000000..cae1111
--- /dev/null
+++ b/macros/ax_require_defined.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_REQUIRE_DEFINED(MACRO)
+#
+# DESCRIPTION
+#
+# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
+# been defined and thus are available for use. This avoids random issues
+# where a macro isn't expanded. Instead the configure script emits a
+# non-fatal:
+#
+# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
+#
+# It's like AC_REQUIRE except it doesn't expand the required macro.
+#
+# Here's an example:
+#
+# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
+#
+# LICENSE
+#
+# Copyright (c) 2014 Mike Frysinger <vapier at gentoo.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 1
+
+AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
+ m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
+])dnl AX_REQUIRE_DEFINED
diff --git a/macros/boost.m4 b/macros/boost.m4
index 280c7ab..188a806 100644
--- a/macros/boost.m4
+++ b/macros/boost.m4
@@ -22,7 +22,6 @@ dnl regex, serialization, signals, unit test, thead, and wave.
AC_DEFUN([GNASH_PATH_BOOST],
[
dnl start variables with a known value
- gnash_boost_version=""
gnash_boost_topdir=""
gnash_boost_libdir=""
missing_headers=""
@@ -53,7 +52,6 @@ AC_DEFUN([GNASH_PATH_BOOST],
AC_ARG_WITH(boost_incl, AC_HELP_STRING([--with-boost-incl], [directory where boost headers are]), with_boost_incl=${withval})
if test x"${with_boost_incl}" != x ; then
gnash_boost_topdir="`(cd ${with_boost_incl}; pwd)`"
- gnash_boost_version="`echo ${gnash_boost_topdir} | sed -e 's:.*boost-::'`"
newlist=${gnash_boost_topdir}
fi
@@ -62,19 +60,6 @@ AC_DEFUN([GNASH_PATH_BOOST],
gcc_version="`${CXX} --version | head -1 | cut -d ' ' -f 3 | cut -d '.' -f 1-2 | tr -d '.'`"
fi
- if test x"${gnash_boost_topdir}" = x; then
- dnl Attempt to find the top level directory, which unfortunately has a
- dnl version number attached. At least on Debian based systems, this
- dnl doesn't seem to get a directory that is unversioned.
- if test x$cross_compiling = xno; then
- if test x"$PKG_CONFIG" != x; then
- AC_MSG_CHECKING([for the Boost Version])
- $PKG_CONFIG --exists boost && gnash_boost_version="`$PKG_CONFIG --modversion boost | cut -d "." -f 1 | awk '{print $'0'".0"}'`"
- AC_MSG_RESULT(${gnash_boost_version})
- fi
- fi
- fi
-
AC_MSG_CHECKING([for boost header])
for i in $newlist; do
gnash_boost_topdir=/usr/include/boost
@@ -83,7 +68,6 @@ AC_DEFUN([GNASH_PATH_BOOST],
if test -n "$u" -a -d "$u" -a x"$u" != x"/usr/include/boost"; then
gnash_boost_topdir="`(cd $u; pwd)`"
gnash_boost_subdir="`dirname ${gnash_boost_topdir}`"
- gnash_boost_version="`echo ${gnash_boost_topdir} | sed -e 's:.*boost-::'`"
dnl Fix for packaging systems not adding extra fluff to the path-name.
for k in ${boost_headers}; do
if test ! -f ${gnash_boost_topdir}/boost/$k; then
@@ -168,7 +152,7 @@ AC_DEFUN([GNASH_PATH_BOOST],
done
fi
- if test x"${missing_libs}" != x ; then
+ if test x"${missing_libs}" != x -o x"${missing_plugin_libs}" != x -o x"${missing_cygnal_libs}" != x; then
AC_MSG_WARN([Libraries ${missing_libs} ${missing_plugin_libs} ${missing_cygnal_libs} aren't installed ])
fi
AC_MSG_RESULT(${ac_cv_path_boost_lib})
diff --git a/macros/ffmpeg.m4 b/macros/ffmpeg.m4
index c3ef987..d1d8426 100644
--- a/macros/ffmpeg.m4
+++ b/macros/ffmpeg.m4
@@ -609,9 +609,10 @@ dnl | libav | 0.8 (53.35.0) S16 | 9 (54.35.0) FLTP |
AC_CHECK_LIB(gsm, gsm_destroy, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lgsm"])
fi
fi
+ else
+ AC_MSG_RESULT(${libgsm})
fi
- AC_MSG_RESULT(${libgsm})
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libgsm}"
dnl End of GSM library looking }
diff --git a/macros/qt4.m4 b/macros/qt4.m4
index 8798dec..a05108c 100644
--- a/macros/qt4.m4
+++ b/macros/qt4.m4
@@ -69,7 +69,9 @@ dnl fi
if ${PKG_CONFIG} --exists QtOpenGL; then
ac_cv_path_qt4_incl="`$PKG_CONFIG --cflags-only-I QtCore QtGui QtOpenGL`"
else
- ac_cv_path_qt4_incl="`$PKG_CONFIG --cflags-only-I QtCore QtGui`"
+ if ${PKG_CONFIG} --exists QtCore QtGui; then
+ ac_cv_path_qt4_incl="`$PKG_CONFIG --cflags-only-I QtCore QtGui`"
+ fi
fi
gnash_qt4_topdir=`echo "${ac_cv_path_qt4_incl}"`
fi
diff --git a/revno.h b/revno.h
index b99e4c0..210a7f5 100644
--- a/revno.h
+++ b/revno.h
@@ -1,3 +1,3 @@
#define BRANCH_REVNO "2"
#define BRANCH_NICK "master"
-#define COMMIT_ID "935df16"
+#define COMMIT_ID "939bcfb"
diff --git a/testsuite/analyse-results.sh b/testsuite/analyse-results.sh
index 82cc53e..1e5ffe9 100755
--- a/testsuite/analyse-results.sh
+++ b/testsuite/analyse-results.sh
@@ -94,14 +94,16 @@ if test ${total_fail} -gt 0 || test ${total_xpass} -gt 0; then
rc=1
timing=$(dirname $0)/timingissues
- > ${timing}.tmp || have_tmpfile=false # distcheck builddir is read-only
+ for t in ${suitefail}; do
+ testruns="${testruns} ${t}/testrun.sum"
+ done
+ failures="grep -hw FAIL ${testruns}"
if test ${total_fail} -gt 0; then
echo "Unexpected failures follow:"
for s in ${suitefail}; do
echo " --=[ ${s} ]=-- "
- grep -w FAIL ${s}/testrun.sum | \
- ($have_tmpfile && tee -a ${timing}.tmp)
+ grep -w FAIL ${s}/testrun.sum
done
echo
fi
@@ -115,24 +117,20 @@ if test ${total_fail} -gt 0 || test ${total_xpass} -gt 0; then
echo
fi
- if test "$have_tmpfile" = "false"; then
- exit $rc
- fi
-
- if test `grep -cf $timing ${timing}.tmp` -gt 0; then
- if test `grep -cvf $timing ${timing}.tmp` -eq 0; then
+ if test `$failures | grep -cf $timing` -gt 0; then
+ if test `$failures | grep -cvf $timing` -eq 0; then
echo "All failures are time-related. Exiting 0."
echo "See http://wiki.gnashdev.org/PredictableLoading"
echo
rc=0
else
echo "Time-related failures follow:"
- grep -f $timing ${timing}.tmp
+ $failures | grep -f $timing
echo
echo "See http://wiki.gnashdev.org/PredictableLoading"
echo
echo "Non time-related failures follow:"
- grep -vf $timing ${timing}.tmp
+ $failures | grep -vf $timing
echo
fi
fi
@@ -141,7 +139,7 @@ if test ${total_fail} -gt 0 || test ${total_xpass} -gt 0; then
if test ${total_fail} -gt 0; then
echo "Verbose mode enabled. Displaying following files:"
echo
- swfdecfail=$(sed -n 's/^.*in \(.*.trace-gnash\).*in \(.*.log\).*$/\1\n\2/p' ${timing}.tmp)
+ swfdecfail=$($failures | sed -n 's/^.*in \(.*.trace-gnash\).*in \(.*.log\).*$/\1\n\2/p')
for log in $swfdecfail; do
echo " testsuite/swfdec/$log"
logfiles="${logfiles} testsuite/swfdec/$log"
@@ -160,7 +158,6 @@ if test ${total_fail} -gt 0 || test ${total_xpass} -gt 0; then
fi
fi
- rm -f ${timing}.tmp
exit $rc
else
exit 0
diff --git a/testsuite/misc-ming.all/Makefile.am b/testsuite/misc-ming.all/Makefile.am
index dd7e72e..bc1c6f9 100644
--- a/testsuite/misc-ming.all/Makefile.am
+++ b/testsuite/misc-ming.all/Makefile.am
@@ -119,7 +119,6 @@ check_PROGRAMS = \
DefineEditTextVariableNameTest-Runner \
DefineEditTextVariableNameTest2 \
Dejagnu \
- Dejagnu.swf \
RemoveObject2Test \
RollOverOutTest \
RollOverOutTest-Runner \
diff --git a/testsuite/network.all/Makefile.am b/testsuite/network.all/Makefile.am
index e117f74..20ebea6 100644
--- a/testsuite/network.all/Makefile.am
+++ b/testsuite/network.all/Makefile.am
@@ -68,7 +68,6 @@ TEST_SSH = test_ssh
endif
check_PROGRAMS = \
Dejagnu \
- Dejagnu.swf \
$(TEST_SSL) \
$(TEST_SSH) \
$(NULL)
diff --git a/testsuite/timingissues b/testsuite/timingissues
index 307c4c0..03f7890 100644
--- a/testsuite/timingissues
+++ b/testsuite/timingissues
@@ -1,15 +1,15 @@
### misc-ming.all/loading/loadMovieTestRunner.cpp:113
-FAIL: loadMovieTestRunner: coverart->get_root()->url() == .* (expected: .*) \[loadMovieTestRunner.cpp:[0-9]*\]
-FAIL: loadMovieTestRunner: expected: \(red.swf\|blue.swf\|green.jpg\) , obtained: \(red.swf\|blue.swf\|green.jpg\) (loadMovieTest.c:[0-9]*)
+FAIL: loadMovieTestRunner: coverart->get_root()->url() == .* (expected: .*) \[.*loadMovieTestRunner.cpp:[0-9]*\]
+FAIL: loadMovieTestRunner: expected: \(red.swf\|blue.swf\|green.jpg\) , obtained: \(red.swf\|blue.swf\|green.jpg\) (.*loadMovieTest.c:[0-9]*)
### misc-ming.all - network tests
FAIL: XMLSocketTester: consistency check: last trace from run of test (.*) doesn't match pattern (ENDOFTEST)
FAIL: rtmpytest-runner: consistency check: last trace from run of test rtmpytest.swf (Connecting to rtmp://www.gnashdev.org:9984/rtmpyecho) doesn't match pattern (ENDOFTEST)
FAIL: oflaDemo-runner: Tests run 34 (expected 17) \[undefined\]
## FAIL: LCTestRunner: consistency check: last trace from run of test (.*) doesn't match pattern (ENDOFTEST)
### misc-mtasc.all
-FAIL: sanetests-runner: expected: "undefined" , obtained: "movieclip" \[level87.as:59\]
-FAIL: sanetests-runner: expected: "1" , obtained: "" \[level87.as:75\]
-FAIL: sanetests-runner: expected: "1" , obtained: "" \[level87.as:72\]
+FAIL: sanetests-runner: expected: "undefined" , obtained: "movieclip" \[.*level87.as:59\]
+FAIL: sanetests-runner: expected: "1" , obtained: "" \[.*level87.as:75\]
+FAIL: sanetests-runner: expected: "1" , obtained: "" \[.*level87.as:72\]
### swfdec
FAIL: run_swfdec_testsuite_g: gotolabel-multiple.swf:[0-9a-f]* (traces in gotolabel-multiple.swf.trace-gnash, log in gotolabel-multiple.swf.log)
FAIL: run_swfdec_testsuite_m: movieclip-lockroot-loadmovie-[678].swf:[0-9a-f]* (traces in movieclip-lockroot-loadmovie-[678].swf.trace-gnash, log in movieclip-lockroot-loadmovie-[678].swf.log)
--
Alioth's hooks/post-receive on /srv/git.debian.org/git/pkg-flash/gnash.git
More information about the pkg-flash-devel
mailing list