Merge commit 'cbcd497f384f0f8ef3f76f85b29b644b900d6b9f'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Oct 2012 11:00:28 +0000 (13:00 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Oct 2012 11:01:27 +0000 (13:01 +0200)
* commit 'cbcd497f384f0f8ef3f76f85b29b644b900d6b9f':
  adxdec: use planar sample format
  adpcmdec: use planar sample format for adpcm_thp
  adpcmdec: use planar sample format for adpcm_ea_xas
  adpcmdec: use planar sample format for adpcm_ea_r1/r2/r3
  adpcmdec: use planar sample format for adpcm_xa
  adpcmdec: use planar sample format for adpcm_ima_ws for vqa version 3
  adpcmdec: use planar sample format for adpcm_4xm
  adpcmdec: use planar sample format for adpcm_ima_wav
  adpcmdec: use planar sample format for adpcm_ima_qt
  pcmdec: use planar sample format for pcm_lxf
  mace: use planar sample format
  atrac1: use planar sample format
  build: non-x86: Only compile mpegvideo optimizations when necessary
  rtpdec_mpeg4: au_headers is a single array, simple av_free is enough
  avcodec: free extended_data instead address of it
  fate: Add tests of the ff_make_absolute_url function
  url: Handle relative urls starting with two slashes
  url: Handle relative urls being just a new query string
  url: Don't treat slashes in query parameters as directory separators

Conflicts:
libavcodec/adxdec.c
libavcodec/mips/Makefile
libavcodec/pcm.c
libavcodec/utils.c
libavformat/Makefile
libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
12 files changed:
1  2 
libavcodec/adpcm.c
libavcodec/adxdec.c
libavcodec/atrac1.c
libavcodec/mace.c
libavcodec/mips/Makefile
libavcodec/pcm.c
libavcodec/utils.c
libavformat/Makefile
libavformat/rtpdec_mpeg4.c
libavformat/url-test.c
libavformat/utils.c
tests/Makefile

@@@ -273,13 -292,20 +292,18 @@@ static int xa_decode(AVCodecContext *av
      int s_1,s_2;
      int d,s,t;
  
-     for(i=0;i<4;i++) {
+     out0 += sample_offset;
+     if (channels == 1)
+         out1 = out0 + 28;
+     else
+         out1 += sample_offset;
  
+     for(i=0;i<4;i++) {
          shift  = 12 - (in[4+i*2] & 15);
          filter = in[4+i*2] >> 4;
 -        if (filter > 4) {
 -            av_log(avctx, AV_LOG_ERROR,
 -                   "Invalid XA-ADPCM filter %d (max. allowed is 4)\n",
 -                   filter);
 -            return AVERROR_INVALIDDATA;
 +        if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) {
 +            av_log_ask_for_sample(avctx, "unknown XA-ADPCM filter %d\n", filter);
 +            filter=0;
          }
          f0 = xa_adpcm_table[filter][0];
          f1 = xa_adpcm_table[filter][1];
@@@ -98,9 -99,9 +99,10 @@@ static int adx_decode_frame(AVCodecCont
  {
      int buf_size        = avpkt->size;
      ADXContext *c       = avctx->priv_data;
-     int16_t *samples;
+     int16_t **samples;
+     int samples_offset;
      const uint8_t *buf  = avpkt->data;
 +    const uint8_t *buf_end = buf + avpkt->size;
      int num_blocks, ch, ret;
  
      if (c->eof) {
  
      while (num_blocks--) {
          for (ch = 0; ch < c->channels; ch++) {
-             if (buf_end - buf < BLOCK_SIZE || adx_decode(c, samples + ch, buf, ch)) {
 -            if (adx_decode(c, samples[ch], samples_offset, buf, ch)) {
++            if (buf_end - buf < BLOCK_SIZE || adx_decode(c, samples[ch], samples_offset, buf, ch)) {
                  c->eof = 1;
                  buf = avpkt->data + avpkt->size;
                  break;
Simple merge
@@@ -232,9 -228,9 +228,9 @@@ static av_cold int mace_decode_init(AVC
  {
      MACEContext *ctx = avctx->priv_data;
  
 -    if (avctx->channels > 2)
 +    if (avctx->channels > 2 || avctx->channels <= 0)
          return -1;
-     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
+     avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
  
      avcodec_get_frame_defaults(&ctx->frame);
      avctx->coded_frame = &ctx->frame;
@@@ -1,19 -1,4 +1,20 @@@
  MMI-OBJS += mips/dsputil_mmi.o                                          \
              mips/idct_mmi.o                                             \
-             mips/mpegvideo_mmi.o
+ MMI-OBJS-$(CONFIG_MPEGVIDEO)            += mips/mpegvideo_mmi.o
 +
 +MIPSFPU-OBJS-$(CONFIG_AMRNB_DECODER)      += mips/acelp_filters_mips.o     \
 +                                             mips/celp_filters_mips.o      \
 +                                             mips/celp_math_mips.o         \
 +                                             mips/acelp_vectors_mips.o
 +MIPSFPU-OBJS-$(CONFIG_AMRWB_DECODER)      += mips/acelp_filters_mips.o     \
 +                                             mips/celp_filters_mips.o      \
 +                                             mips/amrwbdec_mips.o          \
 +                                             mips/celp_math_mips.o         \
 +                                             mips/acelp_vectors_mips.o
 +MIPSFPU-OBJS-$(CONFIG_MPEGAUDIODSP)       += mips/mpegaudiodsp_mips_float.o
 +MIPSDSPR1-OBJS-$(CONFIG_MPEGAUDIODSP)     += mips/mpegaudiodsp_mips_fixed.o
 +OBJS-$(CONFIG_FFT)                        += mips/fft_init_table.o
 +MIPSFPU-OBJS-$(CONFIG_FFT)                += mips/fft_mips.o
 +MIPSFPU-OBJS-$(HAVE_INLINE_ASM)           += mips/fmtconvert_mips.o
 +MIPSFPU-OBJS-$(HAVE_INLINE_ASM)           += mips/dsputil_mips.o
Simple merge
Simple merge
@@@ -412,7 -372,12 +412,8 @@@ OBJS-$(CONFIG_UDP_PROTOCOL
  
  SKIPHEADERS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh.h
  SKIPHEADERS-$(CONFIG_NETWORK)            += network.h rtsp.h
- TESTPROGS = seek
 -
 -EXAMPLES  = metadata                                                    \
 -            output                                                      \
 -
+ TESTPROGS = seek                                                        \
+             url                                                         \
  
  TOOLS     = aviocat                                                     \
              ismindex                                                    \
Simple merge
index 0000000,58258e5..ceaffe8
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,58 +1,58 @@@
 - * This file is part of Libav.
+ /*
+  * Copyright (c) 2012 Martin Storsjo
+  *
 - * Libav is free software; you can redistribute it and/or
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * 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.
+  *
 - * License along with Libav; if not, write to the Free Software
++ * 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 "internal.h"
+ #undef printf
+ #undef exit
+ static void test(const char *base, const char *rel)
+ {
+     char buf[200], buf2[200];
+     ff_make_absolute_url(buf, sizeof(buf), base, rel);
+     printf("%s\n", buf);
+     if (base) {
+         /* Test in-buffer replacement */
+         snprintf(buf2, sizeof(buf2), "%s", base);
+         ff_make_absolute_url(buf2, sizeof(buf2), buf2, rel);
+         if (strcmp(buf, buf2)) {
+             printf("In-place handling of %s + %s failed\n", base, rel);
+             exit(1);
+         }
+     }
+ }
+ int main(void)
+ {
+     test(NULL, "baz");
+     test("/foo/bar", "baz");
+     test("/foo/bar", "../baz");
+     test("/foo/bar", "/baz");
+     test("http://server/foo/", "baz");
+     test("http://server/foo/bar", "baz");
+     test("http://server/foo/", "../baz");
+     test("http://server/foo/bar/123", "../../baz");
+     test("http://server/foo/bar/123", "/baz");
+     test("http://server/foo/bar/123", "https://other/url");
+     test("http://server/foo/bar?param=value/with/slashes", "/baz");
+     test("http://server/foo/bar?param&otherparam", "?someparam");
+     test("http://server/foo/bar", "//other/url");
+     return 0;
+ }
Simple merge
diff --cc tests/Makefile
@@@ -69,8 -47,8 +69,9 @@@ include $(SRC_PATH)/tests/fate/h264.ma
  include $(SRC_PATH)/tests/fate/image.mak
  include $(SRC_PATH)/tests/fate/indeo.mak
  include $(SRC_PATH)/tests/fate/libavcodec.mak
+ include $(SRC_PATH)/tests/fate/libavformat.mak
  include $(SRC_PATH)/tests/fate/libavutil.mak
 +include $(SRC_PATH)/tests/fate/mapchan.mak
  include $(SRC_PATH)/tests/fate/lossless-audio.mak
  include $(SRC_PATH)/tests/fate/lossless-video.mak
  include $(SRC_PATH)/tests/fate/microsoft.mak
@@@ -103,14 -78,14 +104,15 @@@ FATE_AVCONV += $(FATE_LAVF
                 $(FATE_LAVFI)                                            \
                 $(FATE_SEEK)                                             \
  
 -FATE_AVCONV += $(FATE_AVCONV-yes)
 -FATE-$(CONFIG_AVCONV) += $(FATE_AVCONV)
 +FATE_FFMPEG += $(FATE_FFMPEG-yes) $(FATE_AVCONV) $(FATE_AVCONV-yes)
 +FATE-$(CONFIG_FFMPEG) += $(FATE_FFMPEG)
 +FATE-$(CONFIG_FFPROBE) += $(FATE_FFPROBE)
  
  FATE-$(CONFIG_AVCODEC)  += $(FATE_LIBAVCODEC)
+ FATE-$(CONFIG_AVFORMAT) += $(FATE_LIBAVFORMAT)
  
 -FATE_SAMPLES-$(CONFIG_AVCONV) += $(FATE_SAMPLES_AVCONV)
 -FATE_SAMPLES += $(FATE_SAMPLES-yes)
 +FATE_EXTERN-$(CONFIG_FFMPEG) += $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG)
 +FATE_EXTERN += $(FATE_EXTERN-yes)
  
  FATE += $(FATE-yes)
  FATE += $(FATE_LIBAVUTIL)