[FFmpeg-soc] [soc]: r1761 - in eac3: ac3_parser.c ac3dec.c checkout.sh ffmpeg.patch
jbr
subversion at mplayerhq.hu
Sat Jan 5 17:39:05 CET 2008
Author: jbr
Date: Sat Jan 5 17:39:04 2008
New Revision: 1761
Log:
update to FFmpeg SVN r11416
Modified:
eac3/ac3_parser.c
eac3/ac3dec.c
eac3/checkout.sh
eac3/ffmpeg.patch
Modified: eac3/ac3_parser.c
==============================================================================
--- eac3/ac3_parser.c (original)
+++ eac3/ac3_parser.c Sat Jan 5 17:39:04 2008
@@ -117,7 +117,7 @@ int ff_ac3_parse_header(const uint8_t bu
return 0;
}
-static int ac3_sync(AVCodecContext *avctx, const uint8_t *buf, int *channels, int *sample_rate,
+static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate,
int *bit_rate, int *samples)
{
int err;
Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c (original)
+++ eac3/ac3dec.c Sat Jan 5 17:39:04 2008
@@ -229,6 +229,13 @@ static int ac3_decode_init(AVCodecContex
s->mul_bias = 32767.0f;
}
+ /* allow downmixing to stereo or mono */
+ if (avctx->channels > 0 && avctx->request_channels > 0 &&
+ avctx->request_channels < avctx->channels &&
+ avctx->request_channels <= 2) {
+ avctx->channels = avctx->request_channels;
+ }
+
return 0;
}
@@ -1033,9 +1040,12 @@ static int ac3_decode_frame(AVCodecConte
}
/* check for crc mismatch */
- if(av_crc(av_crc8005, 0, &buf[2], s->frame_size-2)) {
- av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
- return -1;
+ if(avctx->error_resilience > 0) {
+ if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) {
+ av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
+ return -1;
+ }
+ /* TODO: error concealment */
}
avctx->sample_rate = s->sample_rate;
Modified: eac3/checkout.sh
==============================================================================
--- eac3/checkout.sh (original)
+++ eac3/checkout.sh Sat Jan 5 17:39:04 2008
@@ -4,7 +4,7 @@ echo "checking out ffmpeg svn"
for i in $FILES Makefile aac_ac3_parser.c aac_ac3_parser.h aac_parser.c allcodecs.c avcodec.h ../libavformat/allformats.h ../libavformat/raw.c allcodecs.h ac3enc.c ../ffmpeg.c; do
rm -f ffmpeg/libavcodec/$i
done
-svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 11360
+svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 11416
echo "patching ffmpeg"
cd ffmpeg
patch -p0 <../ffmpeg.patch
Modified: eac3/ffmpeg.patch
==============================================================================
--- eac3/ffmpeg.patch (original)
+++ eac3/ffmpeg.patch Sat Jan 5 17:39:04 2008
@@ -1,32 +1,6 @@
-Index: libavcodec/aac_ac3_parser.c
-===================================================================
---- libavcodec/aac_ac3_parser.c (revision 11360)
-+++ libavcodec/aac_ac3_parser.c (working copy)
-@@ -50,7 +50,7 @@
-
- if (s->frame_size == 0) {
- if ((s->inbuf_ptr - s->inbuf) == s->header_size) {
-- len = s->sync(s->inbuf, &channels, &sample_rate, &bit_rate,
-+ len = s->sync(avctx, s->inbuf, &channels, &sample_rate, &bit_rate,
- &samples);
- if (len == 0) {
- /* no sync found : move by one byte (inefficient, but simple!) */
-Index: libavcodec/aac_ac3_parser.h
-===================================================================
---- libavcodec/aac_ac3_parser.h (revision 11360)
-+++ libavcodec/aac_ac3_parser.h (working copy)
-@@ -30,7 +30,7 @@
- uint8_t *inbuf_ptr;
- int frame_size;
- int header_size;
-- int (*sync)(const uint8_t *buf, int *channels, int *sample_rate,
-+ int (*sync)(AVCodecContext *avctx, const uint8_t *buf, int *channels, int *sample_rate,
- int *bit_rate, int *samples);
- uint8_t inbuf[8192]; /* input buffer */
- } AACAC3ParseContext;
Index: libavcodec/Makefile
===================================================================
---- libavcodec/Makefile (revision 11360)
+--- libavcodec/Makefile (revision 11416)
+++ libavcodec/Makefile (working copy)
@@ -33,7 +33,7 @@
HEADERS = avcodec.h opt.h
@@ -37,30 +11,9 @@ Index: libavcodec/Makefile
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc.o ac3tab.o ac3.o
OBJS-$(CONFIG_ALAC_DECODER) += alac.o
OBJS-$(CONFIG_AMV_DECODER) += sp5xdec.o mjpegdec.o mjpeg.o
-@@ -318,6 +318,7 @@
- OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o
- OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o
- OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
-+OBJS-$(CONFIG_EAC3_PARSER) += ac3_parser.o ac3tab.o aac_ac3_parser.o
- OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
- OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
- OBJS-$(CONFIG_H264_PARSER) += h264_parser.o
-Index: libavcodec/aac_parser.c
-===================================================================
---- libavcodec/aac_parser.c (revision 11360)
-+++ libavcodec/aac_parser.c (working copy)
-@@ -38,7 +38,7 @@
- };
-
-
--static int aac_sync(const uint8_t *buf, int *channels, int *sample_rate,
-+static int aac_sync(AVCodecContext *avctx, const uint8_t *buf, int *channels, int *sample_rate,
- int *bit_rate, int *samples)
- {
- GetBitContext bits;
Index: libavcodec/ac3enc.c
===================================================================
---- libavcodec/ac3enc.c (revision 11360)
+--- libavcodec/ac3enc.c (revision 11416)
+++ libavcodec/ac3enc.c (working copy)
@@ -479,7 +479,8 @@
for(ch=0;ch<s->nb_all_channels;ch++) {
More information about the FFmpeg-soc
mailing list