gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1789-g1f28d72
Date: Mon, 09 Sep 2013 14:09:49 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  1f28d720334f5cccc9ff6b43aee1380df080932b (commit)
      from  6e6875931a44b2dc33bca2195871948c0a8e7988 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=1f28d720334f5cccc9ff6b43aee1380df080932b


commit 1f28d720334f5cccc9ff6b43aee1380df080932b
Author: Sandro Santilli <address@hidden>
Date:   Mon Sep 9 16:09:00 2013 +0200

    Another use of ScopedPtr in AudioDecoderFfmpeg

diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index e53e211..7239daf 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -499,7 +499,7 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
     size_t outSize = MAX_AUDIO_FRAME_SIZE;
 
     // TODO: make this a private member, to reuse (see NetStreamFfmpeg in 
0.8.3)
-    gnash::ScopedPtr<boost::int16_t> output( 
reinterpret_cast<boost::int16_t*>(av_malloc(outSize)), av_free );
+    ScopedPtr<boost::int16_t> output( 
reinterpret_cast<boost::int16_t*>(av_malloc(outSize)), av_free );
     if (!output.get()) {
         log_error(_("failed to allocate audio buffer."));
         outputSize = 0;
@@ -521,12 +521,12 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* 
input,
     av_init_packet(&pkt);
     pkt.data = const_cast<uint8_t*>(input);
     pkt.size = inputSize;
-    AVFrame *frm = avcodec_alloc_frame();
-    if (!frm) {
+    ScopedPtr<AVFrame> frm ( avcodec_alloc_frame(), av_free );
+    if (!frm.get()) {
         log_error(_("failed to allocate frame."));
         return NULL;
     }
-    int tmp = avcodec_decode_audio4(_audioCodecCtx, frm, &got_frm, &pkt);
+    int tmp = avcodec_decode_audio4(_audioCodecCtx, frm.get(), &got_frm, &pkt);
 
 #ifdef GNASH_DEBUG_AUDIO_DECODING
     const char* fmtname = av_get_sample_fmt_name(_audioCodecCtx->sample_fmt);
@@ -573,7 +573,6 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
                 "data."), outputSize, inputSize);
         log_error(_("Upgrading ffmpeg/libavcodec might fix this issue."));
         outputSize = 0;
-        av_freep(&frm);
         return NULL;
     }
 
@@ -616,8 +615,6 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
         log_debug("resampler returned %d samples ", outSamples);
 #endif
 
-        av_freep(&frm);
-
         if (expectedMaxOutSamples < outSamples) {
             log_error(_(" --- Computation of resampled samples (%d) < then the 
actual returned samples (%d)"),
                 expectedMaxOutSamples, outSamples);
@@ -645,7 +642,6 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* input,
         boost::uint8_t* newOutput = new boost::uint8_t[outSize];
         std::memcpy(newOutput, outPtr, outSize);
         outPtr = reinterpret_cast<boost::int16_t*>(newOutput);
-        av_freep(&frm);
     }
 
     outputSize = outSize;

-----------------------------------------------------------------------

Summary of changes:
 libmedia/ffmpeg/AudioDecoderFfmpeg.cpp |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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