community/gpac to 5324-1

This commit is contained in:
David Beauchamp 2014-09-23 11:55:23 -04:00
parent ae2dd267e3
commit 10027beedd
2 changed files with 46 additions and 36 deletions

View file

@ -5,8 +5,8 @@
# - use PIC with armv7
pkgname=gpac
pkgver=4288
pkgrel=3
pkgver=5324
pkgrel=1
pkgdesc="A multimedia framework based on the MPEG-4 Systems standard"
arch=('i686' 'x86_64')
url="http://gpac.sourceforge.net"
@ -17,9 +17,9 @@ optdepends=('jack: for jack support' 'a52dec: for A52 support'
'faad2: for AAC support' 'libmad: for mp3 support')
options=('staticlibs' '!makeflags')
source=(ftp://ftp.archlinux.org/other/community/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig} gpac-ffmpeg.patch)
sha1sums=('6ba29de672b6e4260e510e0e16d5bc0ab09cabb6'
sha1sums=('cd00b88aa6da97708532fc8eb7ab65f6a0d0c1e0'
'SKIP'
'63f59ab745c57bf7d242e942e30a4e6c7a1236b0')
'e758b8cdb0b4bca37134241a1b8ccc33d4deb54a')
# source PKGBUILD && mksource
mksource() {
@ -41,7 +41,7 @@ mksource() {
prepare() {
cd ${pkgname}-${pkgver}
patch -p0 -i "${srcdir}/gpac-ffmpeg.patch"
patch -p3 -i "${srcdir}/gpac-ffmpeg.patch"
}
build() {

View file

@ -1,37 +1,47 @@
--- modules/ffmpeg_in/ffmpeg_decode.c 2013-03-11 21:43:22.000000000 -0400
+++ modules/ffmpeg_in/ffmpeg_decode.c 2013-07-11 23:38:15.108181474 -0400
@@ -38,7 +38,9 @@
#undef USE_AVCODEC2
--- a/trunk/gpac/modules/ffmpeg_in/ffmpeg_demux.c
+++ b/trunk/gpac/modules/ffmpeg_in/ffmpeg_demux.c
@@ -54,13 +54,10 @@
#endif /* AVERROR_NOFMT */
-#if (LIBAVFORMAT_VERSION_MAJOR >= 54) && (LIBAVFORMAT_VERSION_MINOR >= 20)
+#if ((LIBAVFORMAT_VERSION_MAJOR == 54) && (LIBAVFORMAT_VERSION_MINOR >= 20)) || (LIBAVFORMAT_VERSION_MAJOR > 54)
#define av_find_stream_info(__c) avformat_find_stream_info(__c, NULL)
-#ifndef FF_API_FORMAT_PARAMETERS
-#define FF_API_FORMAT_PARAMETERS 1
-#endif
-
+#define USE_AVFORMAT_OPEN_INPUT 1
#endif
-#if (LIBAVCODEC_VERSION_MAJOR >= 54) && (LIBAVCODEC_VERSION_MINOR >= 35)
+#if (LIBAVCODEC_VERSION_MAJOR >= 55)
+#define USE_AVCTX3
+#elif (LIBAVCODEC_VERSION_MAJOR >= 54) && (LIBAVCODEC_VERSION_MINOR >= 35)
#define USE_AVCTX3
#endif
@@ -625,10 +628,11 @@
if (ffd->frame_start>inBufferLength) ffd->frame_start = 0;
redecode:
- gotpic = AVCODEC_MAX_AUDIO_FRAME_SIZE;
#ifdef USE_AVCODEC2
+ gotpic = 192000;
len = avcodec_decode_audio3(ctx, (short *)ffd->audio_buf, &gotpic, &pkt);
@@ -275,7 +272,7 @@
}
if (!has_audio && !has_video) goto exit;
ret = 1;
-#if LIBAVFORMAT_VERSION_MAJOR < 53 && LIBAVFORMAT_VERSION_MINOR < 45
+#if ((LIBAVFORMAT_VERSION_MAJOR == 52) && (LIBAVFORMAT_VERSION_MINOR <= 47)) || (LIBAVFORMAT_VERSION_MAJOR < 52)
fmt_out = guess_stream_format(NULL, url, NULL);
#else
+ gotpic = AVCODEC_MAX_AUDIO_FRAME_SIZE;
len = avcodec_decode_audio2(ctx, (short *)ffd->audio_buf, &gotpic, inBuffer + ffd->frame_start, inBufferLength - ffd->frame_start);
#endif
if (len<0) { ffd->frame_start = 0; return GF_NON_COMPLIANT_BITSTREAM; }
--- modules/ffmpeg_in/ffmpeg_in.h 2013-03-11 21:43:22.000000000 -0400
+++ modules/ffmpeg_in/ffmpeg_in.h 2013-07-11 23:38:15.108181474 -0400
@@ -120,7 +120,7 @@
fmt_out = av_guess_format(NULL, url, NULL);
@@ -588,7 +585,7 @@
}
/*setup downloader*/
av_in->flags |= AVFMT_NOFILE;
-#if FF_API_FORMAT_PARAMETERS /*commit ffmpeg 603b8bc2a109978c8499b06d2556f1433306eca7*/
+#ifdef USE_AVFORMAT_OPEN_INPUT /*commit ffmpeg 603b8bc2a109978c8499b06d2556f1433306eca7*/
res = avformat_open_input(&ffd->ctx, szName, av_in, NULL);
#else
res = av_open_input_stream(&ffd->ctx, &ffd->io, szName, av_in, NULL);
--- a/trunk/gpac/modules/ffmpeg_in/ffmpeg_in.h
+++ b/trunk/gpac/modules/ffmpeg_in/ffmpeg_in.h
@@ -99,7 +99,7 @@
/*for audio packed frames*/
u32 frame_start;
- char audio_buf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
+ char audio_buf[192000];
Bool check_h264_isma;
#ifndef FFMPEG_OLD_HEADERS
u32 base_ES_ID;
-#if (LIBAVCODEC_VERSION_MAJOR <= 52) && (LIBAVCODEC_VERSION_MINOR <= 20)
+#if ((LIBAVCODEC_VERSION_MAJOR == 52) && (LIBAVCODEC_VERSION_MINOR <= 20)) || (LIBAVCODEC_VERSION_MAJOR < 52)
#undef USE_AVCODEC2
#else
#define USE_AVCODEC2 1