(jarvis) ffmpeg: update to ffmpeg-2.8.1

This commit is contained in:
Stefan Saraev 2015-10-20 01:22:52 -07:00 committed by Stephan Raue
parent 17a0b1be9b
commit 33710c856a
7 changed files with 96 additions and 731 deletions

View File

@ -17,13 +17,13 @@
################################################################################
PKG_NAME="ffmpeg"
PKG_VERSION="2.6.4"
PKG_VERSION="2.8.1"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="LGPLv2.1+"
PKG_SITE="https://ffmpeg.org"
PKG_URL="https://ffmpeg.org/releases/${PKG_NAME}-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain yasm:host zlib bzip2 libvorbis libressl"
PKG_DEPENDS_TARGET="toolchain yasm:host zlib bzip2 libvorbis libressl dcadec"
PKG_PRIORITY="optional"
PKG_SECTION="multimedia"
PKG_SHORTDESC="FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video."
@ -49,13 +49,6 @@ else
FFMPEG_VDPAU="--disable-vdpau"
fi
if [ "$DCADEC_SUPPORT" = yes ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET dcadec"
FFMPEG_LIBDCADEC="--enable-libdcadec"
else
FFMPEG_LIBDCADEC="--disable-libdcadec"
fi
if [ "$DEBUG" = yes ]; then
FFMPEG_DEBUG="--enable-debug --disable-stripping"
else
@ -150,7 +143,7 @@ configure_target() {
--disable-w32threads \
--disable-x11grab \
--enable-network \
--disable-gnutls --enable-libressl \
--disable-gnutls --enable-openssl \
--disable-gray \
--enable-swscale-alpha \
--disable-small \
@ -191,7 +184,7 @@ configure_target() {
--disable-libopencore-amrwb \
--disable-libopencv \
--disable-libdc1394 \
$FFMPEG_LIBDCADEC \
--enable-libdcadec \
--disable-libfaac \
--disable-libfreetype \
--disable-libgsm \

View File

@ -1,141 +0,0 @@
diff -Naur ffmpeg-2.3/configure ffmpeg-2.3.patch/configure
--- ffmpeg-2.3/configure 2014-07-16 03:00:37.000000000 +0200
+++ ffmpeg-2.3.patch/configure 2014-07-27 10:08:44.022632800 +0200
@@ -225,6 +225,7 @@
--enable-libopus enable Opus de/encoding via libopus [no]
--enable-libpulse enable Pulseaudio input via libpulse [no]
--enable-libquvi enable quvi input via libquvi [no]
+ --enable-libressl enable libressl [no]
--enable-librtmp enable RTMP[E] support via librtmp [no]
--enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
--enable-libshine enable fixed-point MP3 encoding via libshine [no]
@@ -1349,6 +1350,7 @@
libopus
libpulse
libquvi
+ libressl
librtmp
libschroedinger
libshine
@@ -2462,7 +2464,7 @@
# protocols
bluray_protocol_deps="libbluray"
ffrtmpcrypt_protocol_deps="!librtmp_protocol"
-ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
+ffrtmpcrypt_protocol_deps_any="gcrypt libressl nettle openssl"
ffrtmpcrypt_protocol_select="tcp_protocol"
ffrtmphttp_protocol_deps="!librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol"
@@ -2493,7 +2495,7 @@
sctp_protocol_select="network"
srtp_protocol_select="rtp_protocol"
tcp_protocol_select="network"
-tls_protocol_deps_any="openssl gnutls"
+tls_protocol_deps_any="libressl openssl gnutls"
tls_protocol_select="tcp_protocol"
udp_protocol_select="network"
unix_protocol_deps="sys_un_h"
@@ -4749,6 +4751,10 @@
enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
+enabled libressl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
+ check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
+ check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
+ die "ERROR: libressl not found"; }
enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
diff -Naur ffmpeg-2.3/libavformat/network.c ffmpeg-2.3.patch/libavformat/network.c
--- ffmpeg-2.3/libavformat/network.c 2014-07-16 03:00:38.000000000 +0200
+++ ffmpeg-2.3.patch/libavformat/network.c 2014-07-27 10:17:17.252998566 +0200
@@ -36,7 +36,7 @@
#endif
#endif
-#if CONFIG_OPENSSL
+#if CONFIG_OPENSSL || CONFIG_LIBRESSL
#include <openssl/ssl.h>
static int openssl_init;
#if HAVE_THREADS
@@ -69,7 +69,7 @@
void ff_tls_init(void)
{
avpriv_lock_avformat();
-#if CONFIG_OPENSSL
+#if CONFIG_OPENSSL || CONFIG_LIBRESSL
if (!openssl_init) {
SSL_library_init();
SSL_load_error_strings();
@@ -101,7 +101,7 @@
void ff_tls_deinit(void)
{
avpriv_lock_avformat();
-#if CONFIG_OPENSSL
+#if CONFIG_OPENSSL || CONFIG_LIBRESSL
openssl_init--;
if (!openssl_init) {
#if HAVE_THREADS
diff -Naur ffmpeg-2.3/libavformat/rtmpdh.c ffmpeg-2.3.patch/libavformat/rtmpdh.c
--- ffmpeg-2.3/libavformat/rtmpdh.c 2014-07-15 02:20:49.000000000 +0200
+++ ffmpeg-2.3.patch/libavformat/rtmpdh.c 2014-07-27 10:17:38.082053995 +0200
@@ -161,7 +161,7 @@
bn_free(dh->priv_key);
av_free(dh);
}
-#elif CONFIG_OPENSSL
+#elif CONFIG_OPENSSL || CONFIG_LIBRESSL
#define bn_new(bn) bn = BN_new()
#define bn_free(bn) BN_free(bn)
#define bn_set_word(bn, w) BN_set_word(bn, w)
diff -Naur ffmpeg-2.3/libavformat/rtmpdh.h ffmpeg-2.3.patch/libavformat/rtmpdh.h
--- ffmpeg-2.3/libavformat/rtmpdh.h 2014-07-15 02:20:49.000000000 +0200
+++ ffmpeg-2.3.patch/libavformat/rtmpdh.h 2014-07-27 10:16:08.495815596 +0200
@@ -45,7 +45,7 @@
long length;
} FF_DH;
-#elif CONFIG_OPENSSL
+#elif CONFIG_OPENSSL || CONFIG_LIBRESSL
#include <openssl/bn.h>
#include <openssl/dh.h>
diff -Naur ffmpeg-2.3/libavformat/tls.c ffmpeg-2.3.patch/libavformat/tls.c
--- ffmpeg-2.3/libavformat/tls.c 2014-07-15 02:20:49.000000000 +0200
+++ ffmpeg-2.3.patch/libavformat/tls.c 2014-07-27 10:18:18.700162096 +0200
@@ -39,7 +39,7 @@
if (c->cred) \
gnutls_certificate_free_credentials(c->cred); \
} while (0)
-#elif CONFIG_OPENSSL
+#elif CONFIG_OPENSSL || CONFIG_LIBRESSL
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
@@ -63,7 +63,7 @@
#if CONFIG_GNUTLS
gnutls_session_t session;
gnutls_certificate_credentials_t cred;
-#elif CONFIG_OPENSSL
+#elif CONFIG_OPENSSL || CONFIG_LIBRESSL
SSL_CTX *ctx;
SSL *ssl;
#endif
@@ -115,7 +115,7 @@
p.events = POLLOUT;
else
p.events = POLLIN;
-#elif CONFIG_OPENSSL
+#elif CONFIG_OPENSSL || CONFIG_LIBRESSL
ret = SSL_get_error(c->ssl, ret);
if (ret == SSL_ERROR_WANT_READ) {
p.events = POLLIN;
@@ -285,7 +285,7 @@
goto fail;
}
}
-#elif CONFIG_OPENSSL
+#elif CONFIG_OPENSSL || CONFIG_LIBRESSL
c->ctx = SSL_CTX_new(c->listen ? TLSv1_server_method() : TLSv1_client_method());
if (!c->ctx) {
av_log(h, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL));

View File

@ -1,7 +1,7 @@
From d81499ed3d0c7e165845a63464c0051faccd3e43 Mon Sep 17 00:00:00 2001
From beecab7dbe5f2c3c8b1c01d10656505b073b7c10 Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Sun, 11 Sep 2011 19:04:51 +0200
Subject: [PATCH 01/15] Support raw dvdsub palette as stored on normal dvd's
Subject: [PATCH 01/12] Support raw dvdsub palette as stored on normal dvd's
This is how the palette is stored on dvd's. Currently
only xbmc passes the palette information to libavcodec
@ -11,7 +11,7 @@ this way.
1 file changed, 24 insertions(+)
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index ffb2bcc..fc2adde 100644
index 7120f10..4440f00 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -64,6 +64,24 @@ static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *
@ -39,7 +39,7 @@ index ffb2bcc..fc2adde 100644
static int decode_run_2bit(GetBitContext *gb, int *color)
{
unsigned int v, t;
@@ -707,6 +725,12 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
@@ -708,6 +726,12 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
parse_ifo_palette(ctx, ctx->ifo_str);
if (ctx->palette_str)
parse_palette(ctx, ctx->palette_str);
@ -53,10 +53,10 @@ index ffb2bcc..fc2adde 100644
int i;
av_log(avctx, AV_LOG_DEBUG, "palette:");
From 609ed71bf6b1e5e72802b935b44903a266d6d7d4 Mon Sep 17 00:00:00 2001
From 612990b5e41df5b52ad6463e6b804945d37dd3e2 Mon Sep 17 00:00:00 2001
From: Cory Fields <theuni-nospam-@xbmc.org>
Date: Mon, 28 Jun 2010 01:55:31 -0400
Subject: [PATCH 02/15] if av_read_packet returns AVERROR_IO, we are done.
Subject: [PATCH 02/12] if av_read_packet returns AVERROR_IO, we are done.
ffmpeg's codecs might or might not handle returning any completed demuxed
packets correctly
@ -65,10 +65,10 @@ Subject: [PATCH 02/15] if av_read_packet returns AVERROR_IO, we are done.
1 file changed, 2 insertions(+)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1467f31..fb0bc21 100644
index e67147c..88c51fd 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1319,6 +1319,8 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
@@ -1329,6 +1329,8 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
if (ret < 0) {
if (ret == AVERROR(EAGAIN))
return ret;
@ -78,10 +78,10 @@ index 1467f31..fb0bc21 100644
for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
From f509b8930a71d1200b1437fb65ff779bbdd1ca86 Mon Sep 17 00:00:00 2001
From b0576542dafb1bea44f752a6aea59dce5162959b Mon Sep 17 00:00:00 2001
From: Cory Fields <theuni-nospam-@xbmc.org>
Date: Mon, 28 Jun 2010 02:10:50 -0400
Subject: [PATCH 03/15] added: Ticket #7187, TV Teletext support for DVB EBU
Subject: [PATCH 03/12] added: Ticket #7187, TV Teletext support for DVB EBU
Teletext streams
---
@ -90,12 +90,12 @@ Subject: [PATCH 03/15] added: Ticket #7187, TV Teletext support for DVB EBU
2 files changed, 6 insertions(+)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 575dae1..4ea6e5a 100644
index 9d38b59..bc1b1b9 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -524,6 +524,10 @@ enum AVCodecID {
AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'),
@@ -532,6 +532,10 @@ enum AVCodecID {
AV_CODEC_ID_ASS = MKBETAG('A','S','S',' '), ///< ASS as defined in Matroska
AV_CODEC_ID_HDMV_TEXT_SUBTITLE = MKBETAG('B','D','T','X'),
+ /* data codecs */
+ AV_CODEC_ID_VBI_DATA= 0x17500,
@ -105,10 +105,10 @@ index 575dae1..4ea6e5a 100644
AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
AV_CODEC_ID_TTF = 0x18000,
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 9e9ad47..74a9cc5 100644
index ed0a86b..b285f2b 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -731,6 +731,8 @@ static const StreamType DESC_types[] = {
@@ -756,6 +756,8 @@ static const StreamType DESC_types[] = {
{ 0x7b, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DTS },
{ 0x56, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_DVB_TELETEXT },
{ 0x59, AVMEDIA_TYPE_SUBTITLE, AV_CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */
@ -118,20 +118,20 @@ index 9e9ad47..74a9cc5 100644
};
From 43a21520a07cc98957146816db857ea1dd63f926 Mon Sep 17 00:00:00 2001
From e1ba26f0389b1033341a3dea7fe600c93be790fe Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Sun, 18 Sep 2011 19:16:34 +0200
Subject: [PATCH 04/15] Don't accept mpegts PMT that isn't current
Subject: [PATCH 04/12] Don't accept mpegts PMT that isn't current
---
libavformat/mpegts.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 74a9cc5..3c8d99b 100644
index b285f2b..0643bc7 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -573,6 +573,7 @@ typedef struct SectionHeader {
@@ -585,6 +585,7 @@ typedef struct SectionHeader {
uint8_t tid;
uint16_t id;
uint8_t version;
@ -139,7 +139,7 @@ index 74a9cc5..3c8d99b 100644
uint8_t sec_num;
uint8_t last_sec_num;
} SectionHeader;
@@ -644,6 +645,7 @@ static int parse_section_header(SectionHeader *h,
@@ -667,6 +668,7 @@ static int parse_section_header(SectionHeader *h,
val = get8(pp, p_end);
if (val < 0)
return val;
@ -147,30 +147,30 @@ index 74a9cc5..3c8d99b 100644
h->version = (val >> 1) & 0x1f;
val = get8(pp, p_end);
if (val < 0)
@@ -1973,6 +1975,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
@@ -2019,6 +2021,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
return;
if (ts->skip_changes)
return;
+ if (!h->current)
+ return;
ts->stream->ts_id = h->id;
if (skip_identical(h, tssf))
return;
From de503ed6757c7e0f09acd032bed04a2414874087 Mon Sep 17 00:00:00 2001
From 262670f195f933c553f446f1283911854ed4f05c Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Sun, 18 Sep 2011 19:17:23 +0200
Subject: [PATCH 05/15] Don't reparse PMT unless it's version has changed
Subject: [PATCH 05/12] Don't reparse PMT unless it's version has changed
---
libavformat/mpegts.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 3c8d99b..88e5638 100644
index 0643bc7..ea7d335 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -87,6 +87,7 @@ struct MpegTSFilter {
@@ -91,6 +91,7 @@ struct MpegTSFilter {
int es_id;
int last_cc; /* last cc code (-1 if first packet) */
int64_t last_pcr;
@ -178,7 +178,7 @@ index 3c8d99b..88e5638 100644
enum MpegTSFilterType type;
union {
MpegTSPESFilter pes_filter;
@@ -449,6 +450,7 @@ static MpegTSFilter *mpegts_open_filter(MpegTSContext *ts, unsigned int pid,
@@ -459,6 +460,7 @@ static MpegTSFilter *mpegts_open_filter(MpegTSContext *ts, unsigned int pid,
filter->es_id = -1;
filter->last_cc = -1;
filter->last_pcr= -1;
@ -186,7 +186,7 @@ index 3c8d99b..88e5638 100644
return filter;
}
@@ -1977,6 +1979,10 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
@@ -2023,6 +2025,10 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
return;
if (!h->current)
return;
@ -195,13 +195,13 @@ index 3c8d99b..88e5638 100644
+ filter->last_version = h->version;
+ av_dlog(ts->stream, "version=%d\n", filter->last_version);
ts->stream->ts_id = h->id;
if (skip_identical(h, tssf))
return;
From 2905dd6f7acdb839ec0bf20636eae6c4f98058e9 Mon Sep 17 00:00:00 2001
From aedee74aa7ec24958938a9baa0bff1d12004d305 Mon Sep 17 00:00:00 2001
From: Cory Fields <theuni-nospam-@xbmc.org>
Date: Fri, 9 Jul 2010 16:43:31 -0400
Subject: [PATCH 06/15] Read PID timestamps as well as PCR timestamps to find
Subject: [PATCH 06/12] Read PID timestamps as well as PCR timestamps to find
location in mpegts stream
---
@ -209,10 +209,10 @@ Subject: [PATCH 06/15] Read PID timestamps as well as PCR timestamps to find
1 file changed, 46 insertions(+), 2 deletions(-)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 88e5638..56cb44f 100644
index ea7d335..b46f875 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2464,6 +2464,44 @@ static void seek_back(AVFormatContext *s, AVIOContext *pb, int64_t pos) {
@@ -2518,6 +2518,44 @@ static void seek_back(AVFormatContext *s, AVIOContext *pb, int64_t pos) {
av_log(s, pb->seekable ? AV_LOG_ERROR : AV_LOG_INFO, "Unable to seek back to the start\n");
}
@ -257,7 +257,7 @@ index 88e5638..56cb44f 100644
static int mpegts_read_header(AVFormatContext *s)
{
MpegTSContext *ts = s->priv_data;
@@ -2664,6 +2702,7 @@ static av_unused int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
@@ -2723,6 +2761,7 @@ static av_unused int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
uint8_t buf[TS_PACKET_SIZE];
int pcr_l, pcr_pid =
((PESContext *)s->streams[stream_index]->priv_data)->pcr_pid;
@ -265,7 +265,7 @@ index 88e5638..56cb44f 100644
int pos47 = ts->pos47_full % ts->raw_packet_size;
pos =
((*ppos + ts->raw_packet_size - 1 - pos47) / ts->raw_packet_size) *
@@ -2685,6 +2724,11 @@ static av_unused int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
@@ -2744,6 +2783,11 @@ static av_unused int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
*ppos = pos;
return timestamp;
}
@ -277,7 +277,7 @@ index 88e5638..56cb44f 100644
pos += ts->raw_packet_size;
}
@@ -2784,7 +2828,7 @@ AVInputFormat ff_mpegts_demuxer = {
@@ -2843,7 +2887,7 @@ AVInputFormat ff_mpegts_demuxer = {
.read_header = mpegts_read_header,
.read_packet = mpegts_read_packet,
.read_close = mpegts_read_close,
@ -286,7 +286,7 @@ index 88e5638..56cb44f 100644
.flags = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
.priv_class = &mpegts_class,
};
@@ -2796,7 +2840,7 @@ AVInputFormat ff_mpegtsraw_demuxer = {
@@ -2855,7 +2899,7 @@ AVInputFormat ff_mpegtsraw_demuxer = {
.read_header = mpegts_read_header,
.read_packet = mpegts_raw_read_packet,
.read_close = mpegts_read_close,
@ -296,20 +296,20 @@ index 88e5638..56cb44f 100644
.priv_class = &mpegtsraw_class,
};
From d8c13412948c24c3b474f4a0f879af795392cb08 Mon Sep 17 00:00:00 2001
From e4bdfe863c6db2180d948ba04cd6c702307b510a Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Sat, 22 Oct 2011 19:01:38 +0200
Subject: [PATCH 07/15] Get stream durations using read_timestamp
Subject: [PATCH 07/12] Get stream durations using read_timestamp
---
libavformat/utils.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index fb0bc21..e48e3bb 100644
index 88c51fd..966f4d2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2384,6 +2384,41 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
@@ -2455,6 +2455,41 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
#define DURATION_MAX_READ_SIZE 250000LL
#define DURATION_MAX_RETRY 4
@ -351,7 +351,7 @@ index fb0bc21..e48e3bb 100644
/* only usable for MPEG-PS streams */
static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
{
@@ -2534,6 +2569,10 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
@@ -2605,6 +2640,10 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
* the components */
fill_all_stream_timings(ic);
ic->duration_estimation_method = AVFMT_DURATION_FROM_STREAM;
@ -363,10 +363,10 @@ index fb0bc21..e48e3bb 100644
/* less precise: use bitrate info */
estimate_timings_from_bit_rate(ic);
From 3815ee4ab3a546d0251f8b4381bdf5c4752b8cee Mon Sep 17 00:00:00 2001
From 97bc03588a385a50743fdb1e49863c0ef133fc75 Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Wed, 8 Dec 2010 14:03:43 +0000
Subject: [PATCH 08/15] changed: allow 4 second skew between streams in mov
Subject: [PATCH 08/12] changed: allow 4 second skew between streams in mov
before attempting to seek
---
@ -374,10 +374,10 @@ Subject: [PATCH 08/15] changed: allow 4 second skew between streams in mov
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index de4004f..a5babb7 100644
index a8d72b4..8523806 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4189,8 +4189,8 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
@@ -4511,8 +4511,8 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
if (!sample || (!s->pb->seekable && current_sample->pos < sample->pos) ||
(s->pb->seekable &&
((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
@ -389,10 +389,10 @@ index de4004f..a5babb7 100644
best_dts = dts;
*st = avst;
From 3d83b4730868612b8aac5f51a85ce61cd18f46c8 Mon Sep 17 00:00:00 2001
From ad0ab7047a2041b6c152468de1a739644064c6e8 Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Fri, 26 Nov 2010 20:56:48 +0000
Subject: [PATCH 09/15] fixed: memleak in mpegts demuxer on some malformed (??)
Subject: [PATCH 09/12] fixed: memleak in mpegts demuxer on some malformed (??)
mpegts files with too large pes packets
at-visions sample file brokenStream.mpg
@ -401,10 +401,10 @@ at-visions sample file brokenStream.mpg
1 file changed, 6 insertions(+)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 56cb44f..b68a73a 100644
index b46f875..3f6c9e1 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -834,6 +834,10 @@ static void reset_pes_packet_state(PESContext *pes)
@@ -867,6 +867,10 @@ static void reset_pes_packet_state(PESContext *pes)
static void new_pes_packet(PESContext *pes, AVPacket *pkt)
{
@ -415,7 +415,7 @@ index 56cb44f..b68a73a 100644
av_init_packet(pkt);
pkt->buf = pes->buffer;
@@ -2655,6 +2659,8 @@ static int mpegts_read_packet(AVFormatContext *s, AVPacket *pkt)
@@ -2714,6 +2718,8 @@ static int mpegts_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->size = -1;
ts->pkt = pkt;
@ -425,20 +425,20 @@ index 56cb44f..b68a73a 100644
if (ret < 0) {
av_free_packet(ts->pkt);
From bdf8c821a63ff30681ee2a18de1f7774d7611d27 Mon Sep 17 00:00:00 2001
From 43f9a7b6c3b2343cb71c8c691773abd38e0a3af0 Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Mon, 28 Jun 2010 21:26:54 +0000
Subject: [PATCH 10/15] Speed up mpegts av_find_stream_info
Subject: [PATCH 10/12] Speed up mpegts av_find_stream_info
---
libavformat/mpegts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b68a73a..336d869 100644
index 3f6c9e1..8112d89 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -996,7 +996,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
@@ -1029,7 +1029,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
goto skip;
/* stream not present in PMT */
@ -448,11 +448,11 @@ index b68a73a..336d869 100644
goto skip;
From 23e9ea7c3964417e15b83745d2fd6341952cc4a3 Mon Sep 17 00:00:00 2001
From 3132f9576db57c6773cb156a450a65ad185a282f Mon Sep 17 00:00:00 2001
From: marc <mhocking@ubuntu-desktop.(none)>
Date: Mon, 18 Feb 2013 17:18:18 +0000
Subject: [PATCH 11/15] dxva-h264 Fix dxva playback of streams that don't start
with an I-Frame.
Subject: [PATCH 11/12] dxva-h264 Fix dxva playback of streams that don't start
with an I-Frame (adjusted to 2.7)
---
libavcodec/dxva2_h264.c | 8 ++++++++
@ -462,10 +462,10 @@ Subject: [PATCH 11/15] dxva-h264 Fix dxva playback of streams that don't start
4 files changed, 12 insertions(+)
diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index 6deccc3..85b25fd 100644
index 99b80ba..eb5ecd1 100644
--- a/libavcodec/dxva2_h264.c
+++ b/libavcodec/dxva2_h264.c
@@ -451,6 +451,14 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx)
@@ -497,6 +497,14 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx)
if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
return -1;
@ -477,28 +477,28 @@ index 6deccc3..85b25fd 100644
+ h->got_first_iframe = 1;
+ }
+
ret = ff_dxva2_common_end_frame(avctx, &h->cur_pic_ptr->f,
ret = ff_dxva2_common_end_frame(avctx, h->cur_pic_ptr->f,
&ctx_pic->pp, sizeof(ctx_pic->pp),
&ctx_pic->qm, sizeof(ctx_pic->qm),
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a32366e..cbb5385 100644
index 907943e..718b746 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1093,6 +1093,7 @@ void ff_h264_flush_change(H264Context *h)
h->list_count = 0;
h->current_slice = 0;
h->mmco_reset = 1;
+ h->got_first_iframe = 0;
}
@@ -1087,6 +1087,7 @@ void ff_h264_flush_change(H264Context *h)
/* forget old pics after a seek */
h->next_outputed_poc = INT_MIN;
h->prev_interlaced_frame = 1;
+ h->got_first_iframe = 0;
idr(h);
h->prev_frame_num = -1;
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index b260d55..5cb7851 100644
index 7356288..907ee5e 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -741,6 +741,8 @@ typedef struct H264Context {
int luma_weight_flag[2]; ///< 7.4.3.2 luma_weight_lX_flag
int chroma_weight_flag[2]; ///< 7.4.3.2 chroma_weight_lX_flag
@@ -813,6 +813,8 @@ typedef struct H264Context {
* slices) anymore */
int setup_finished;
+ int got_first_iframe;
+
@ -506,11 +506,11 @@ index b260d55..5cb7851 100644
int sei_buffering_period_present; ///< Buffering period SEI flag
int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index d8b7bc7..5f80858 100644
index a346ccb..17e693f 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1175,6 +1175,7 @@ static int h264_slice_header_init(H264Context *h, int reinit)
ff_h264_free_tables(h, 0);
@@ -1043,6 +1043,7 @@ static int h264_slice_header_init(H264Context *h)
h->first_field = 0;
h->prev_interlaced_frame = 1;
+ h->got_first_iframe = 0;
@ -518,10 +518,10 @@ index d8b7bc7..5f80858 100644
init_scan_tables(h);
ret = ff_h264_alloc_tables(h);
From d3112c920a04c24f4b92ab0f67a4275ff4a0c64f Mon Sep 17 00:00:00 2001
From 89edc04503a9c8512c464f70d1def6a0a009e051 Mon Sep 17 00:00:00 2001
From: wsnipex <wsnipex@a1.net>
Date: Mon, 16 Feb 2015 09:58:28 +0100
Subject: [PATCH 12/15] only check for a git rev if the src tree is in a git
Subject: [PATCH 12/12] only check for a git rev if the src tree is in a git
repo
fixes the version string when building from the kodi depends src tree
@ -583,157 +583,3 @@ index f9754eb..cc23f80 100755
fi
# no revision number found
From 3bb6304898994e4278263edd879f07e59ab1fd6f Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Thu, 12 Mar 2015 12:49:48 +0100
Subject: [PATCH 13/15] hevc: avoid unnecessary calls to get_format
---
libavcodec/hevc.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index b7ad29a..77b0c0c 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -280,7 +280,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
return 0;
}
-static int set_sps(HEVCContext *s, const HEVCSPS *sps)
+static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum AVPixelFormat pix_fmt)
{
#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL)
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
@@ -304,13 +304,18 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
#endif
}
- *fmt++ = sps->pix_fmt;
- *fmt = AV_PIX_FMT_NONE;
+ if (pix_fmt == AV_PIX_FMT_NONE) {
+ *fmt++ = sps->pix_fmt;
+ *fmt = AV_PIX_FMT_NONE;
- ret = ff_thread_get_format(s->avctx, pix_fmts);
- if (ret < 0)
- goto fail;
- s->avctx->pix_fmt = ret;
+ ret = ff_thread_get_format(s->avctx, pix_fmts);
+ if (ret < 0)
+ goto fail;
+ s->avctx->pix_fmt = ret;
+ }
+ else {
+ s->avctx->pix_fmt = pix_fmt;
+ }
ff_set_sar(s->avctx, sps->vui.sar);
@@ -420,7 +425,7 @@ static int hls_slice_header(HEVCContext *s)
sh->no_output_of_prior_pics_flag = 0;
}
ff_hevc_clear_refs(s);
- ret = set_sps(s, s->sps);
+ ret = set_sps(s, s->sps, AV_PIX_FMT_NONE);
if (ret < 0)
return ret;
@@ -3335,7 +3340,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
}
if (s->sps != s0->sps)
- if ((ret = set_sps(s, s0->sps)) < 0)
+ if ((ret = set_sps(s, s0->sps, src->pix_fmt)) < 0)
return ret;
s->seq_decode = s0->seq_decode;
From 5eac38c7f2593c2e8aced6907e4f283f91e48691 Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Thu, 2 Apr 2015 13:43:06 +0200
Subject: [PATCH 14/15] vda: fix h264 decoding for avcC,vda wants the entire
buffer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/h264.c | 2 +-
libavcodec/vda_h264.c | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index cbb5385..6529d98 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1596,7 +1596,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
decode_postinit(h, nal_index >= nals_needed);
if (h->avctx->hwaccel &&
- (ret = h->avctx->hwaccel->start_frame(h->avctx, NULL, 0)) < 0)
+ (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0)
return ret;
if (CONFIG_H264_VDPAU_DECODER &&
h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c
index 081c366..b6b9ab4 100644
--- a/libavcodec/vda_h264.c
+++ b/libavcodec/vda_h264.c
@@ -320,9 +320,20 @@ static int vda_h264_start_frame(AVCodecContext *avctx,
uint32_t size)
{
VDAContext *vda = avctx->internal->hwaccel_priv_data;
-
- vda->bitstream_size = 0;
-
+ H264Context *h = avctx->priv_data;
+
+ if (h->is_avc == 1) {
+ void *tmp;
+ vda->bitstream_size = 0;
+ tmp = av_fast_realloc(vda->bitstream,
+ &vda->allocated_size,
+ size);
+ vda->bitstream = tmp;
+ memcpy(vda->bitstream, buffer, size);
+ vda->bitstream_size = size;
+ } else {
+ vda->bitstream_size = 0;
+ }
return 0;
}
@@ -333,6 +344,9 @@ static int vda_h264_decode_slice(AVCodecContext *avctx,
VDAContext *vda = avctx->internal->hwaccel_priv_data;
void *tmp;
+ if (h->is_avc == 1)
+ return 0;
+
tmp = av_fast_realloc(vda->bitstream,
&vda->allocated_size,
vda->bitstream_size + size + 4);
From e1bde78b7cc95cb13da6c91555d141e37a85b692 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Thu, 2 Apr 2015 15:58:02 +0200
Subject: [PATCH 15/15] avcodec/vda_h264: try to fix build
Found-by: Stefano Pigozzi
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/vda_h264.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c
index b6b9ab4..2a18330 100644
--- a/libavcodec/vda_h264.c
+++ b/libavcodec/vda_h264.c
@@ -342,6 +342,7 @@ static int vda_h264_decode_slice(AVCodecContext *avctx,
uint32_t size)
{
VDAContext *vda = avctx->internal->hwaccel_priv_data;
+ H264Context *h = avctx->priv_data;
void *tmp;
if (h->is_avc == 1)

View File

@ -1,280 +0,0 @@
From 519868de7d9c99876efcaf57d6a9683c22732cde Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Thu, 19 Mar 2015 23:56:22 +0100
Subject: [PATCH] avcodec: add libdcadec decoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
configure | 4 +
libavcodec/Makefile | 1 +
libavcodec/allcodecs.c | 1 +
libavcodec/libdcadec.c | 197 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 203 insertions(+)
create mode 100644 libavcodec/libdcadec.c
diff --git a/configure b/configure
index 1bf8f80..a449bc7 100755
--- a/configure
+++ b/configure
@@ -210,6 +210,7 @@ External library support:
--enable-libcdio enable audio CD grabbing with libcdio [no]
--enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
and libraw1394 [no]
+ --enable-libdcadec enable DCA decoding via libdcadec [no]
--enable-libfaac enable AAC encoding via libfaac [no]
--enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
--enable-libflite enable flite (voice synthesis) support via libflite [no]
@@ -1353,6 +1354,7 @@ EXTERNAL_LIBRARY_LIST="
libcdio
libcelt
libdc1394
+ libdcadec
libfaac
libfdk_aac
libflite
@@ -2359,6 +2361,7 @@ vc1_parser_select="mpegvideo startcode vc1_decoder"
# external libraries
libaacplus_encoder_deps="libaacplus"
libcelt_decoder_deps="libcelt"
+libdcadec_decoder_deps="libdcadec"
libfaac_encoder_deps="libfaac"
libfaac_encoder_select="audio_frame_queue"
libfdk_aac_decoder_deps="libfdk_aac"
@@ -4922,6 +4925,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
+enabled libdcadec && require libdcadec dca_context.h dcadec_context_create -ldcadec
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 4173f88..1a0c734 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -732,6 +732,7 @@ OBJS-$(CONFIG_ELBG_FILTER) += elbg.o
# external codec libraries
OBJS-$(CONFIG_LIBAACPLUS_ENCODER) += libaacplus.o
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
+OBJS-$(CONFIG_LIBDCADEC_DECODER) += libdcadec.o
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
OBJS-$(CONFIG_LIBFDK_AAC_DECODER) += libfdk-aacdec.o
OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 5194e74..bbf70a6 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -512,6 +512,7 @@ void avcodec_register_all(void)
/* external libraries */
REGISTER_DECODER(LIBCELT, libcelt);
+ REGISTER_DECODER(LIBDCADEC, libdcadec)
REGISTER_ENCODER(LIBFAAC, libfaac);
REGISTER_ENCDEC (LIBFDK_AAC, libfdk_aac);
REGISTER_ENCDEC (LIBGSM, libgsm);
diff --git a/libavcodec/libdcadec.c b/libavcodec/libdcadec.c
new file mode 100644
index 0000000..d060db5
--- /dev/null
+++ b/libavcodec/libdcadec.c
@@ -0,0 +1,197 @@
+/*
+ * libdcadec decoder wrapper
+ * Copyright (C) 2015 Hendrik Leppkes
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <dca_context.h>
+
+#include "libavutil/avassert.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/common.h"
+#include "libavutil/opt.h"
+#include "avcodec.h"
+#include "dca.h"
+#include "dca_syncwords.h"
+#include "internal.h"
+
+typedef struct DCADecContext {
+ struct dcadec_context *ctx;
+ uint8_t *buffer;
+ int buffer_size;
+} DCADecContext;
+
+static int dcadec_decode_frame(AVCodecContext *avctx, void *data,
+ int *got_frame_ptr, AVPacket *avpkt)
+{
+ DCADecContext *s = avctx->priv_data;
+ AVFrame *frame = data;
+ int ret, i, k;
+ int **samples, nsamples, channel_mask, sample_rate, bits_per_sample, profile;
+ uint32_t mrk;
+ uint8_t *input = avpkt->data;
+ int input_size = avpkt->size;
+
+ /* convert bytestream syntax to RAW BE format if required */
+ mrk = AV_RB32(input);
+ if (mrk != DCA_SYNCWORD_CORE_BE && mrk != DCA_SYNCWORD_SUBSTREAM) {
+ s->buffer = av_fast_realloc(s->buffer, &s->buffer_size, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!s->buffer)
+ return AVERROR(ENOMEM);
+
+ if ((ret = avpriv_dca_convert_bitstream(avpkt->data, avpkt->size, s->buffer, s->buffer_size)) < 0)
+ return ret;
+
+ input = s->buffer;
+ input_size = ret;
+ }
+
+ if ((ret = dcadec_context_parse(s->ctx, input, input_size)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "dcadec_context_parse() failed: %d (%s)\n", -ret, dcadec_strerror(ret));
+ return AVERROR_EXTERNAL;
+ }
+ if ((ret = dcadec_context_filter(s->ctx, &samples, &nsamples, &channel_mask,
+ &sample_rate, &bits_per_sample, &profile)) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "dcadec_context_filter() failed: %d (%s)\n", -ret, dcadec_strerror(ret));
+ return AVERROR_EXTERNAL;
+ }
+
+ avctx->channels = av_get_channel_layout_nb_channels(channel_mask);
+ avctx->channel_layout = channel_mask;
+ avctx->sample_rate = sample_rate;
+
+ av_assert0(bits_per_sample >= 16 && bits_per_sample <= 24);
+ if (bits_per_sample == 16)
+ avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
+ else
+ avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
+
+ avctx->bits_per_raw_sample = bits_per_sample;
+
+ switch (profile) {
+ case DCADEC_PROFILE_DS:
+ avctx->profile = FF_PROFILE_DTS;
+ break;
+ case DCADEC_PROFILE_DS_96_24:
+ avctx->profile = FF_PROFILE_DTS_96_24;
+ break;
+ case DCADEC_PROFILE_DS_ES:
+ avctx->profile = FF_PROFILE_DTS_ES;
+ break;
+ case DCADEC_PROFILE_HD_HRA:
+ avctx->profile = FF_PROFILE_DTS_HD_HRA;
+ break;
+ case DCADEC_PROFILE_HD_MA:
+ avctx->profile = FF_PROFILE_DTS_HD_MA;
+ break;
+ case DCADEC_PROFILE_EXPRESS:
+ avctx->profile = FF_PROFILE_DTS_EXPRESS;
+ break;
+ case DCADEC_PROFILE_UNKNOWN:
+ default:
+ avctx->profile = FF_PROFILE_UNKNOWN;
+ break;
+ }
+
+ /* bitrate is only meaningful if there are no HD extensions, as they distort the bitrate */
+ if (profile == DCADEC_PROFILE_DS || profile == DCADEC_PROFILE_DS_96_24 || profile == DCADEC_PROFILE_DS_ES) {
+ struct dcadec_core_info *info = dcadec_context_get_core_info(s->ctx);
+ avctx->bit_rate = info->bit_rate;
+ dcadec_context_free_core_info(info);
+ } else
+ avctx->bit_rate = 0;
+
+ frame->nb_samples = nsamples;
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ return ret;
+
+ for (i = 0; i < avctx->channels; i++) {
+ if (frame->format == AV_SAMPLE_FMT_S16P) {
+ int16_t *plane = (int16_t *)frame->extended_data[i];
+ for (k = 0; k < nsamples; k++)
+ plane[k] = samples[i][k];
+ } else {
+ int32_t *plane = (int32_t *)frame->extended_data[i];
+ int shift = 32 - bits_per_sample;
+ for (k = 0; k < nsamples; k++)
+ plane[k] = samples[i][k] << shift;
+ }
+ }
+
+ *got_frame_ptr = 1;
+
+ return avpkt->size;
+}
+
+static av_cold void dcadec_flush(AVCodecContext *avctx)
+{
+ DCADecContext *s = avctx->priv_data;
+ dcadec_context_clear(s->ctx);
+}
+
+static av_cold int dcadec_close(AVCodecContext *avctx)
+{
+ DCADecContext *s = avctx->priv_data;
+
+ dcadec_context_destroy(s->ctx);
+ s->ctx = NULL;
+
+ av_freep(&s->buffer);
+
+ return 0;
+}
+
+static av_cold int dcadec_init(AVCodecContext *avctx)
+{
+ DCADecContext *s = avctx->priv_data;
+
+ s->ctx = dcadec_context_create(0);
+ if (!s->ctx)
+ return AVERROR(ENOMEM);
+
+ avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
+ avctx->bits_per_raw_sample = 24;
+
+ return 0;
+}
+
+static const AVProfile profiles[] = {
+ { FF_PROFILE_DTS, "DTS" },
+ { FF_PROFILE_DTS_ES, "DTS-ES" },
+ { FF_PROFILE_DTS_96_24, "DTS 96/24" },
+ { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
+ { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
+ { FF_PROFILE_DTS_EXPRESS, "DTS Express" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+AVCodec ff_libdcadec_decoder = {
+ .name = "libdcadec",
+ .long_name = NULL_IF_CONFIG_SMALL("dcadec DCA decoder"),
+ .type = AVMEDIA_TYPE_AUDIO,
+ .id = AV_CODEC_ID_DTS,
+ .priv_data_size = sizeof(DCADecContext),
+ .init = dcadec_init,
+ .decode = dcadec_decode_frame,
+ .close = dcadec_close,
+ .flush = dcadec_flush,
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_CHANNEL_CONF,
+ .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P,
+ AV_SAMPLE_FMT_NONE },
+ .profiles = NULL_IF_CONFIG_SMALL(profiles),
+};
--
1.9.1

View File

@ -1,40 +0,0 @@
From 4f3c31df3f569c7171ee9e651ddf479690367b9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
Date: Fri, 20 Mar 2015 01:58:25 +0100
Subject: [PATCH] avcodec: Fix libdcadec include dir
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
configure | 2 +-
libavcodec/libdcadec.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index a449bc7..1ef83e3 100755
--- a/configure
+++ b/configure
@@ -4925,7 +4925,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
-enabled libdcadec && require libdcadec dca_context.h dcadec_context_create -ldcadec
+enabled libdcadec && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
diff --git a/libavcodec/libdcadec.c b/libavcodec/libdcadec.c
index d060db5..a28b983 100644
--- a/libavcodec/libdcadec.c
+++ b/libavcodec/libdcadec.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <dca_context.h>
+#include <libdcadec/dca_context.h>
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
--
1.9.1

View File

@ -1,25 +0,0 @@
From 11fe56c8bbf39cd0c3edbf0cd404dea400ff7e0c Mon Sep 17 00:00:00 2001
From: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Thu, 19 Mar 2015 23:45:39 +0100
Subject: [PATCH] avcodec: add profile define for DTS Express
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
libavcodec/avcodec.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index cdc8aa1..48e212f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2851,6 +2851,7 @@ typedef struct AVCodecContext {
#define FF_PROFILE_DTS_96_24 40
#define FF_PROFILE_DTS_HD_HRA 50
#define FF_PROFILE_DTS_HD_MA 60
+#define FF_PROFILE_DTS_EXPRESS 70
#define FF_PROFILE_MPEG2_422 0
#define FF_PROFILE_MPEG2_HIGH 1
--
1.9.1

View File

@ -0,0 +1,12 @@
diff --git a/configure b/configure
index 3960b73..2d9ec93 100755
--- a/configure
+++ b/configure
@@ -4545,7 +4545,6 @@ die_license_disabled nonfree libaacplus
die_license_disabled nonfree libfaac
die_license_disabled nonfree nvenc
enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
-enabled gpl && die_license_disabled_gpl nonfree openssl
die_license_disabled version3 libopencore_amrnb
die_license_disabled version3 libopencore_amrwb