[FFmpeg-soc] [soc]: r3025 - in eac3: ac3dec.c checkout.sh eac3dec.c ffmpeg.patch
jbr
subversion at mplayerhq.hu
Tue Aug 5 04:48:17 CEST 2008
Author: jbr
Date: Tue Aug 5 04:48:17 2008
New Revision: 3025
Log:
share the log_missing_feature function and make it more generic
Modified:
eac3/ac3dec.c
eac3/checkout.sh
eac3/eac3dec.c
eac3/ffmpeg.patch
Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c (original)
+++ eac3/ac3dec.c Tue Aug 5 04:48:17 2008
@@ -787,7 +787,7 @@ static int decode_audio_block(AC3DecodeC
/* spectral extension strategy */
if (s->eac3 && (!blk || get_bits1(gbc))) {
if (get_bits1(gbc)) {
- ff_eac3_log_missing_feature(s->avctx, "Spectral extension");
+ av_log_missing_feature(s->avctx, "Spectral extension", 1);
return -1;
}
/* TODO: parse spectral extension strategy info */
@@ -814,7 +814,7 @@ static int decode_audio_block(AC3DecodeC
/* check for enhanced coupling */
if (s->eac3 && get_bits1(gbc)) {
/* TODO: parse enhanced coupling strategy info */
- ff_eac3_log_missing_feature(s->avctx, "Enhanced coupling");
+ av_log_missing_feature(s->avctx, "Enhanced coupling", 1);
return -1;
}
Modified: eac3/checkout.sh
==============================================================================
--- eac3/checkout.sh (original)
+++ eac3/checkout.sh Tue Aug 5 04:48:17 2008
@@ -1,10 +1,10 @@
FILES="eac3dec.c ac3dec.c"
echo "checking out ffmpeg svn"
-for i in $FILES Makefile ac3enc.c ac3dec.h; do
+for i in $FILES Makefile ac3enc.c ac3dec.h avcodec.h utils.c; do
rm -f ffmpeg/libavcodec/$i
done
-svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 14540
+svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 14614
echo "patching ffmpeg"
cd ffmpeg
patch -p0 <../ffmpeg.patch
Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c (original)
+++ eac3/eac3dec.c Tue Aug 5 04:48:17 2008
@@ -37,16 +37,6 @@ typedef enum {
static int idct_cos_tab[6][5];
-void ff_eac3_log_missing_feature(AVCodecContext *avctx, const char *log){
- av_log(avctx, AV_LOG_ERROR, "%s is not implemented. If you want to help, "
- "update your FFmpeg version to the newest one from SVN. If the "
- "problem still occurs, it means that your file has extension "
- "which has not been tested due to a lack of samples exhibiting "
- "this feature. Upload a sample of the audio from this file to "
- "ftp://upload.mplayerhq.hu/incoming and contact the ffmpeg-devel "
- "mailing list.\n", log);
-}
-
void ff_eac3_get_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch){
int bin, blk, gs;
int end_bap, gaq_mode;
@@ -156,7 +146,7 @@ static int parse_bsi(AC3DecodeContext *s
application can select from. each independent stream can also contain
dependent streams which are used to add or replace channels. */
if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
- ff_eac3_log_missing_feature(s->avctx, "Dependent substream");
+ av_log_missing_feature(s->avctx, "Dependent substream decoding", 1);
return AC3_PARSE_ERROR_FRAME_TYPE;
} else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
@@ -168,8 +158,7 @@ static int parse_bsi(AC3DecodeContext *s
associated to an independent stream have matching substream id's */
if (s->substreamid) {
// TODO: allow user to select which substream to decode
- av_log(s->avctx, AV_LOG_INFO, "Skipping additional substream #%d\n",
- s->substreamid);
+ av_log_missing_feature(s->avctx, "Additional substreams", 1);
return AC3_PARSE_ERROR_FRAME_TYPE;
}
@@ -178,7 +167,7 @@ static int parse_bsi(AC3DecodeContext *s
rates in bit allocation. The best assumption would be that it is
handled like AC-3 DolbyNet, but we cannot be sure until we have a
sample which utilizes this feature. */
- ff_eac3_log_missing_feature(s->avctx, "Reduced Sampling Rates");
+ av_log_missing_feature(s->avctx, "Reduced sampling rates", 1);
return -1;
}
skip_bits(gbc, 5); // skip bitstream id
Modified: eac3/ffmpeg.patch
==============================================================================
--- eac3/ffmpeg.patch (original)
+++ eac3/ffmpeg.patch Tue Aug 5 04:48:17 2008
@@ -1,8 +1,8 @@
Index: libavcodec/ac3dec.h
===================================================================
---- libavcodec/ac3dec.h (revision 14540)
+--- libavcodec/ac3dec.h (revision 14614)
+++ libavcodec/ac3dec.h (working copy)
-@@ -172,4 +172,10 @@
+@@ -172,4 +172,9 @@
///@}
} AC3DecodeContext;
@@ -10,12 +10,32 @@ Index: libavcodec/ac3dec.h
+void ff_eac3_get_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
+void ff_eac3_idct_transform_coeffs_ch(AC3DecodeContext *s, int ch, int blk);
+void ff_eac3_tables_init(void);
-+void ff_eac3_log_missing_feature(AVCodecContext *avctx, const char *log);
+
#endif /* FFMPEG_AC3DEC_H */
+Index: libavcodec/utils.c
+===================================================================
+--- libavcodec/utils.c (revision 14614)
++++ libavcodec/utils.c (working copy)
+@@ -1513,3 +1513,16 @@
+ else
+ return 0;
+ }
++
++void av_log_missing_feature(void *avc, const char *feature, int want_sample)
++{
++ av_log(avc, AV_LOG_WARNING, "%s not implemented. Update your FFmpeg "
++ "version to the newest one from SVN. If the problem still "
++ "occurs, it means that your file has a feature which has not "
++ "been implemented.", feature);
++ if(want_sample)
++ av_log(avc, AV_LOG_WARNING, " If you want to help, upload a sample "
++ "of this file to ftp://upload.mplayerhq.hu/MPlayer/incoming/ "
++ "and contact the FFmpeg-devel mailing list.");
++ av_log(avc, AV_LOG_WARNING, "\n");
++}
Index: libavcodec/Makefile
===================================================================
---- libavcodec/Makefile (revision 14540)
+--- libavcodec/Makefile (revision 14614)
+++ libavcodec/Makefile (working copy)
@@ -26,7 +26,7 @@
OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
@@ -26,9 +46,32 @@ 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
+Index: libavcodec/avcodec.h
+===================================================================
+--- libavcodec/avcodec.h (revision 14614)
++++ libavcodec/avcodec.h (working copy)
+@@ -3007,6 +3007,18 @@
+ */
+ int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
+
++/**
++ * Logs a generic warning message about a missing feature.
++ * @param[in] avc a pointer to an arbitrary struct of which the first field is
++ * a pointer to an AVClass struct
++ * @param[in] feature string containing the name of the missing feature
++ * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
++ * If \p want_sample is non-zero, additional verbage will be added to the log
++ * message which tells the user how to report samples to the development
++ * mailing list.
++ */
++void av_log_missing_feature(void *avc, const char *feature, int want_sample);
++
+ /* error handling */
+ #if EINVAL > 0
+ #define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
Index: libavcodec/ac3enc.c
===================================================================
---- libavcodec/ac3enc.c (revision 14540)
+--- libavcodec/ac3enc.c (revision 14614)
+++ libavcodec/ac3enc.c (working copy)
@@ -1365,5 +1365,5 @@
AC3_encode_close,
More information about the FFmpeg-soc
mailing list