summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-30 13:41:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-30 13:41:43 +0100
commit89ec4f4d5eb9d2c60ccec2f4c14e19949ae77326 (patch)
treee857be124197182f784a2437007ffefbc450367e
parent612d9cdbe90a9cb0319b093efa54efa71bb1e4c4 (diff)
parent670bb1c9795f2647d89669b293ea2fce3d64d594 (diff)
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master: Fix compilation with --enable-decoder=webp --disable-decoder=vp8 Do not show "Estimating duration from bitrate" warning if no duration was estimated. Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/x86/Makefile2
-rw-r--r--libavformat/utils.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 38ef867715..e1573c0161 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -31,6 +31,7 @@ OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp_init.o
OBJS-$(CONFIG_VP5_DECODER) += x86/vp56dsp_init.o
OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp_init.o
OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp_init.o
+OBJS-$(CONFIG_WEBP_DECODER) += x86/vp8dsp_init.o
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
MMX-OBJS-$(CONFIG_DSPUTIL) += x86/dsputil_mmx.o \
@@ -85,6 +86,7 @@ YASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o
YASM-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp.o
YASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp.o
YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o
+YASM-OBJS-$(CONFIG_WEBP_DECODER) += x86/vp8dsp.o
YASM-OBJS-$(CONFIG_DSPUTIL) += x86/dsputil.o \
x86/mpeg4qpel.o \
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d0393f9db2..0a12d8ab1d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2304,7 +2304,7 @@ static void fill_all_stream_timings(AVFormatContext *ic)
static void estimate_timings_from_bit_rate(AVFormatContext *ic)
{
int64_t filesize, duration;
- int bit_rate, i;
+ int bit_rate, i, show_warning = 0;
AVStream *st;
/* if bit_rate is already set, we believe it */
@@ -2329,10 +2329,13 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
&& st->duration == AV_NOPTS_VALUE) {
duration= av_rescale(8*filesize, st->time_base.den, ic->bit_rate*(int64_t)st->time_base.num);
st->duration = duration;
+ show_warning = 1;
}
}
}
}
+ if (show_warning)
+ av_log(ic, AV_LOG_WARNING, "Estimating duration from bitrate, this may be inaccurate\n");
}
#define DURATION_MAX_READ_SIZE 250000LL
@@ -2440,7 +2443,6 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
fill_all_stream_timings(ic);
ic->duration_estimation_method = AVFMT_DURATION_FROM_STREAM;
} else {
- av_log(ic, AV_LOG_WARNING, "Estimating duration from bitrate, this may be inaccurate\n");
/* less precise: use bitrate info */
estimate_timings_from_bit_rate(ic);
ic->duration_estimation_method = AVFMT_DURATION_FROM_BITRATE;