16.02.14 20:25, Dan Dennedy написав(ла):
On Sun, Feb 16, 2014 at 6:30 AM, Maksym Veremeyenko<ve...@m1stereo.tv>  wrote:
Hi,

if i specify pcm_s24le on output audio codec, consumer_avformat wrongly
calculate a number of output samples and as result audio encoding function
failed because of resulted packed buffer size greater then submitted.

This requires a libavcodec version check. From some basic checking, it
needs FFmpeg v1.0:
#define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 59
#define LIBAVCODEC_VERSION_MICRO 100

or libav 9.4:
#define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 35
#define LIBAVCODEC_VERSION_MICRO  0

We require the higher minor number to prevent compilation failure on FFmpeg v?



updated patch with

#if LIBAVCODEC_VERSION_INT >= ((54<<16)+(59<<8)+0)
[...]
#endif

attached

--
________________________________________
Maksym Veremeyenko
Senior System Administrator
IT Department
Ukrainian Music Television Channel "M1"

DDI. +380 44 205-44-92
Tel. +380 44 205-44-80
Fax. +380 44 205-44-82
Cell. +380-67-447-22-43

E-mail : maksym.veremeye...@m1stereo.tv
Web site: www.m1stereo.tv
>From 5376178021e8e3e2144e6ef53e7593e675ddb63b Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1.tv>
Date: Mon, 17 Feb 2014 10:55:48 +0200
Subject: [PATCH] fix samples number calculation for 24 and 32 bit output

---
 src/modules/avformat/consumer_avformat.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
index 8776de8..b4753fa 100644
--- a/src/modules/avformat/consumer_avformat.c
+++ b/src/modules/avformat/consumer_avformat.c
@@ -709,6 +709,20 @@ static int open_audio( mlt_properties properties, AVFormatContext *oc, AVStream
 				case AV_CODEC_ID_PCM_U16BE:
 					audio_input_frame_size >>= 1;
 					break;
+#if LIBAVCODEC_VERSION_INT >= ((54<<16)+(59<<8)+0)
+				case AV_CODEC_ID_PCM_S24LE:
+				case AV_CODEC_ID_PCM_S24BE:
+				case AV_CODEC_ID_PCM_U24LE:
+				case AV_CODEC_ID_PCM_U24BE:
+					audio_input_frame_size /= 3;
+					break;
+				case AV_CODEC_ID_PCM_S32LE:
+				case AV_CODEC_ID_PCM_S32BE:
+				case AV_CODEC_ID_PCM_U32LE:
+				case AV_CODEC_ID_PCM_U32BE:
+					audio_input_frame_size >>= 2;
+					break;
+#endif
 				default:
 					break;
 			}
-- 
1.7.7.6

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to