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-2220-g98f4523
Date: Wed, 23 Sep 2015 13:47:28 +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  98f45235e1a89b9834de5095ae9eb630019e7b8d (commit)
       via  09fb39cd5b7d2956e87c46cda58c57359d7d935f (commit)
       via  f71f77ef1dc030ac091b6f3beafe9975d725225f (commit)
       via  1ac2492ce7ca4bcc241cc5b7e0a5542dbd22f429 (commit)
       via  058c338618aa3dcdaa92834c601c6b96f4bc2b9f (commit)
       via  f3e1688fd5c9a2bd57970996c5c200aa387ce844 (commit)
      from  516a6cae2301c582b54d7f00188c8e22c5d76c1b (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=98f45235e1a89b9834de5095ae9eb630019e7b8d


commit 98f45235e1a89b9834de5095ae9eb630019e7b8d
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 23 15:47:15 2015 +0200

    Update item about bug #45722

diff --git a/NEWS b/NEWS
index 266863d..f63b8d7 100644
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,7 @@ Caveats:
 
 Improvements since 0.8.10 release are:
 
- * Fix loud screech after playing PCM audio with GST backend (#45722)
+ * Fix screeches and crashes playing PCM audio (#45722)
  * Fix corrupted WAV file on --audio-dump (#45887)
  * Fix callback registration issue in ExternalInterface (#37223)
  * Fix possible out-of-bound read in parser (#43865)

http://git.savannah.gnu.org/cgit//commit/?id=09fb39cd5b7d2956e87c46cda58c57359d7d935f


commit 09fb39cd5b7d2956e87c46cda58c57359d7d935f
Author: Nutchanon Wetchasit <address@hidden>
Date:   Wed Sep 23 15:40:56 2015 +0200

    Fix wrong resampling factor and sample count calculation in FFmpeg-based 
audio resampling.

diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index a0c64f9..2244a6b 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -544,13 +544,26 @@ AudioDecoderFfmpeg::decodeFrame(const std::uint8_t* input,
 
         // Compute new size based on frame_size and
         // resampling configuration
-        double resampleFactor = (44100.0/_audioCodecCtx->sample_rate) * 
(2.0/_audioCodecCtx->channels);
+
+        // Find out the needed sample rate scaling
+        double resampleFactor = 44100.0/_audioCodecCtx->sample_rate;
+
+        // Compute total number of input samples
+        int inSamples = outSize;
         bool stereo = _audioCodecCtx->channels > 1 ? true : false;
-        int inSamples = stereo ? outSize >> 2 : outSize >> 1;
 
+        if (stereo) inSamples = inSamples >> 1;
+        if (_audioCodecCtx->sample_fmt == AV_SAMPLE_FMT_S16 ||
+            _audioCodecCtx->sample_fmt == AV_SAMPLE_FMT_S16P) {
+            inSamples = inSamples >> 1;
+        }
+
+        // Compute total number of output samples
         int expectedMaxOutSamples = std::ceil(inSamples*resampleFactor);
 
-        // *channels *sampleSize 
+        // Compute output buffer size (in bytes); by multiplying
+        // output samples count with output sample format's frame size,
+        // which is number of bytes per sample (2) times channels (2).
         int resampledFrameSize = expectedMaxOutSamples*2*2;
 
         // Allocate just the required amount of bytes

http://git.savannah.gnu.org/cgit//commit/?id=f71f77ef1dc030ac091b6f3beafe9975d725225f


commit f71f77ef1dc030ac091b6f3beafe9975d725225f
Author: Nutchanon Wetchasit <address@hidden>
Date:   Wed Sep 23 15:40:42 2015 +0200

    Use the original sample rate when utilizing FFmpeg 8-bit PCM codec.

diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index 0d08a33..a0c64f9 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -283,8 +283,7 @@ void AudioDecoderFfmpeg::setup(const AudioInfo& info)
                 break;
 
             case AV_CODEC_ID_PCM_U8:
-                // Either FFMPEG or the parser are getting this wrong.
-                _audioCodecCtx->sample_rate = info.sampleRate / 2;
+                _audioCodecCtx->sample_rate = info.sampleRate;
                 _audioCodecCtx->channels = (info.stereo ? 2 : 1);
                 break;
             case AV_CODEC_ID_PCM_S16LE:

http://git.savannah.gnu.org/cgit//commit/?id=1ac2492ce7ca4bcc241cc5b7e0a5542dbd22f429


commit 1ac2492ce7ca4bcc241cc5b7e0a5542dbd22f429
Author: Nutchanon Wetchasit <address@hidden>
Date:   Wed Sep 23 15:39:57 2015 +0200

    Use a correct FFmpeg codec ID for 8-bit PCM sound.

diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index c98e2d8..0d08a33 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -181,9 +181,17 @@ void AudioDecoderFfmpeg::setup(const AudioInfo& info)
             case AUDIO_CODEC_UNCOMPRESSED:
             case AUDIO_CODEC_RAW:
                 if (info.sampleSize == 2) {
+                    // Flash's 16-bit UNCOMPRESSED and RAW audio comes as
+                    // a signed PCM format. UNCOMPRESSED audio always use
+                    // little-endian byte order. RAW audio uses encoder's
+                    // native byte order; as majority of encoders run
+                    // on little-endian machine, we use little-endian for it.
                     codec_id = AV_CODEC_ID_PCM_S16LE;
                 } else {
-                    codec_id = AV_CODEC_ID_PCM_S8;
+                    // Flash's 8-bit UNCOMPRESSED and RAW audio comes as an
+                    // unsigned PCM format. No difference between
+                    // UNCOMPRESSED and RAW.
+                    codec_id = AV_CODEC_ID_PCM_U8;
                 }
                 break;
 
@@ -274,7 +282,7 @@ void AudioDecoderFfmpeg::setup(const AudioInfo& info)
             case AV_CODEC_ID_MP3:
                 break;
 
-            case AV_CODEC_ID_PCM_S8:
+            case AV_CODEC_ID_PCM_U8:
                 // Either FFMPEG or the parser are getting this wrong.
                 _audioCodecCtx->sample_rate = info.sampleRate / 2;
                 _audioCodecCtx->channels = (info.stereo ? 2 : 1);
diff --git a/libmedia/ffmpeg/ffmpegHeaders.h b/libmedia/ffmpeg/ffmpegHeaders.h
index 53b5b18..2e4944e 100644
--- a/libmedia/ffmpeg/ffmpegHeaders.h
+++ b/libmedia/ffmpeg/ffmpegHeaders.h
@@ -107,6 +107,7 @@ extern "C" {
 #define AV_CODEC_ID_NELLYMOSER CODEC_ID_NELLYMOSER
 #define AV_CODEC_ID_NONE CODEC_ID_NONE
 #define AV_CODEC_ID_PCM_S8 CODEC_ID_PCM_S8
+#define AV_CODEC_ID_PCM_U8 CODEC_ID_PCM_U8
 #define AV_CODEC_ID_PCM_S16LE CODEC_ID_PCM_S16LE
 #define AV_CODEC_ID_PCM_U16LE CODEC_ID_PCM_U16LE
 #define AV_CODEC_ID_VP6A CODEC_ID_VP6A

http://git.savannah.gnu.org/cgit//commit/?id=058c338618aa3dcdaa92834c601c6b96f4bc2b9f


commit 058c338618aa3dcdaa92834c601c6b96f4bc2b9f
Author: Nutchanon Wetchasit <address@hidden>
Date:   Wed Sep 23 15:39:42 2015 +0200

    Don't skip resampling non-16 bit audio when swresample.h and avresample.h 
are both unavailable.

diff --git a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp 
b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
index bd2f864..87cc558 100644
--- a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
@@ -49,9 +49,7 @@ AudioResamplerFfmpeg::~AudioResamplerFfmpeg() {
 bool
 AudioResamplerFfmpeg::init(AVCodecContext* ctx) {
     if ((ctx->sample_rate != 44100) ||
-#if defined(HAVE_SWRESAMPLE_H) || defined(HAVE_AVRESAMPLE_H)
         (ctx->sample_fmt != AV_SAMPLE_FMT_S16) ||
-#endif
         (ctx->channels != 2)) {
         if (! _context) {
 #ifdef HAVE_SWRESAMPLE_H

http://git.savannah.gnu.org/cgit//commit/?id=f3e1688fd5c9a2bd57970996c5c200aa387ce844


commit f3e1688fd5c9a2bd57970996c5c200aa387ce844
Author: Nutchanon Wetchasit <address@hidden>
Date:   Wed Sep 23 15:39:29 2015 +0200

    Use source sample format when calling FFmpeg/libAV audio resampler.

diff --git a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp 
b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
index 0b0dc6c..bd2f864 100644
--- a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
@@ -61,7 +61,7 @@ AudioResamplerFfmpeg::init(AVCodecContext* ctx) {
 #else
             _context = av_audio_resample_init(2, ctx->channels,
                 44100, ctx->sample_rate,
-                AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
+                AV_SAMPLE_FMT_S16, ctx->sample_fmt,
                 16, 10, 0, 0.8);
 #endif
 #if defined(HAVE_SWRESAMPLE_H) || defined(HAVE_AVRESAMPLE_H)

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

Summary of changes:
 NEWS                                     |    2 +-
 libmedia/ffmpeg/AudioDecoderFfmpeg.cpp   |   34 +++++++++++++++++++++++------
 libmedia/ffmpeg/AudioResamplerFfmpeg.cpp |    4 +--
 libmedia/ffmpeg/ffmpegHeaders.h          |    1 +
 4 files changed, 30 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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