[FFmpeg-cvslog] frame: Remove some FF_API_AVFRAME_COLORSPACE leftovers

2014-08-14 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Wed Aug 13 
22:35:47 2014 +0200| [e070d0a5ca9047192e324a3f87006b316e2a08a7] | committer: 
Diego Biurrun

frame: Remove some FF_API_AVFRAME_COLORSPACE leftovers

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e070d0a5ca9047192e324a3f87006b316e2a08a7
---

 libavutil/frame.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index 4b154f3..48df311 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -385,13 +385,11 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
 dst->coded_picture_number   = src->coded_picture_number;
 dst->display_picture_number = src->display_picture_number;
 dst->flags  = src->flags;
-#if FF_API_AVFRAME_COLORSPACE
 dst->color_primaries= src->color_primaries;
 dst->color_trc  = src->color_trc;
 dst->colorspace = src->colorspace;
 dst->color_range= src->color_range;
 dst->chroma_location= src->chroma_location;
-#endif
 
 memcpy(dst->error, src->error, sizeof(dst->error));
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] vaapi: set the scaling list correctly.

2014-08-14 Thread Edgar Hucek
ffmpeg | branch: master | Edgar Hucek  | Sun Sep 11 
12:53:17 2011 +0200| [ab059f0aa896e01e8e4529f5f714fde111f05377] | committer: 
Anton Khirnov

vaapi: set the scaling list correctly.

Fixes VAAPI decoding artefacts.

CC:libav-sta...@libav.org

Signed-off-by: Anton Khirnov 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab059f0aa896e01e8e4529f5f714fde111f05377
---

 libavcodec/vaapi_h264.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index 7529f04..651a50b 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -282,7 +282,8 @@ static int vaapi_h264_start_frame(AVCodecContext  
*avctx,
 if (!iq_matrix)
 return -1;
 memcpy(iq_matrix->ScalingList4x4, h->pps.scaling_matrix4, 
sizeof(iq_matrix->ScalingList4x4));
-memcpy(iq_matrix->ScalingList8x8, h->pps.scaling_matrix8, 
sizeof(iq_matrix->ScalingList8x8));
+memcpy(iq_matrix->ScalingList8x8[0], h->pps.scaling_matrix8[0], 
sizeof(iq_matrix->ScalingList8x8[0]));
+memcpy(iq_matrix->ScalingList8x8[1], h->pps.scaling_matrix8[3], 
sizeof(iq_matrix->ScalingList8x8[0]));
 return 0;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'ab059f0aa896e01e8e4529f5f714fde111f05377'

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
12:31:51 2014 +0200| [87988d6569ce603fc5a29a806a241dde5651242f] | committer: 
Michael Niedermayer

Merge commit 'ab059f0aa896e01e8e4529f5f714fde111f05377'

* commit 'ab059f0aa896e01e8e4529f5f714fde111f05377':
  vaapi: set the scaling list correctly.

See: 3fec40b601827e75aae9f0baa47671af15de181a
Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=87988d6569ce603fc5a29a806a241dde5651242f
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'e070d0a5ca9047192e324a3f87006b316e2a08a7'

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
12:34:17 2014 +0200| [de7b08cbc1c11482405504e76f402e5c32b60f22] | committer: 
Michael Niedermayer

Merge commit 'e070d0a5ca9047192e324a3f87006b316e2a08a7'

* commit 'e070d0a5ca9047192e324a3f87006b316e2a08a7':
  frame: Remove some FF_API_AVFRAME_COLORSPACE leftovers

Conflicts:
libavutil/frame.c

No change, as these leftovers have already been removed

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de7b08cbc1c11482405504e76f402e5c32b60f22
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] a64: Return correct error code on invalid data stream

2014-08-14 Thread Nidhi Makhijani
ffmpeg | branch: master | Nidhi Makhijani  | Wed Aug 13 
18:12:55 2014 +0530| [0528226a05cc08b74197547fba0b1939bf68990d] | committer: 
Diego Biurrun

a64: Return correct error code on invalid data stream

Signed-off-by: Diego Biurrun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0528226a05cc08b74197547fba0b1939bf68990d
---

 libavformat/a64.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/a64.c b/libavformat/a64.c
index da8e310..c8e8e64 100644
--- a/libavformat/a64.c
+++ b/libavformat/a64.c
@@ -38,7 +38,7 @@ static int a64_write_header(AVFormatContext *s)
 
 if (avctx->extradata_size < 4) {
 av_log(s, AV_LOG_ERROR, "Missing extradata\n");
-return AVERROR(EINVAL);
+return AVERROR_INVALIDDATA;
 }
 
 switch (avctx->codec->id) {
@@ -53,7 +53,7 @@ static int a64_write_header(AVFormatContext *s)
 header[4] = 3;
 break;
 default:
-return AVERROR(EINVAL);
+return AVERROR_INVALIDDATA;
 }
 avio_write(s->pb, header, 2);
 return 0;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '0528226a05cc08b74197547fba0b1939bf68990d'

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
12:42:49 2014 +0200| [8d403d9c89febcbca094206a866c82426fbcd1c8] | committer: 
Michael Niedermayer

Merge commit '0528226a05cc08b74197547fba0b1939bf68990d'

* commit '0528226a05cc08b74197547fba0b1939bf68990d':
  a64: Return correct error code on invalid data stream

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d403d9c89febcbca094206a866c82426fbcd1c8
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] mpeg4video: Fix doxygen comment syntax to document correct struct member

2014-08-14 Thread Nidhi Makhijani
ffmpeg | branch: master | Nidhi Makhijani  | Tue Aug 12 
18:16:17 2014 +0530| [93f29948e4b06acfb96e7f82d373ef86d6dc55f7] | committer: 
Diego Biurrun

mpeg4video: Fix doxygen comment syntax to document correct struct member

Also fix some comment typos.

Signed-off-by: Diego Biurrun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93f29948e4b06acfb96e7f82d373ef86d6dc55f7
---

 libavcodec/mpeg4video.h |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index b092684..22d6d59 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -62,29 +62,29 @@
 typedef struct Mpeg4DecContext {
 MpegEncContext m;
 
-///< number of bits to represent the fractional part of time
+/// number of bits to represent the fractional part of time
 int time_increment_bits;
 int shape;
 int vol_sprite_usage;
 int sprite_brightness_change;
 int num_sprite_warping_points;
-///< sprite trajectory points
+/// sprite trajectory points
 uint16_t sprite_traj[4][2];
-///< sprite shift [isChroma]
+/// sprite shift [isChroma]
 int sprite_shift[2];
 
 // reversible vlc
 int rvlc;
-///< could this stream contain resync markers
+/// could this stream contain resync markers
 int resync_marker;
-///< time distance of first I -> B, used for interlaced b frames
+/// time distance of first I -> B, used for interlaced B-frames
 int t_frame;
 
 int new_pred;
 int enhancement_type;
 int scalability;
 int use_intra_dc_vlc;
-///< QP above whch the ac VLC should be used for intra dc
+/// QP above which the ac VLC should be used for intra dc
 int intra_dc_threshold;
 
 /* bug workarounds */
@@ -92,11 +92,11 @@ typedef struct Mpeg4DecContext {
 int divx_build;
 int xvid_build;
 int lavc_build;
-///< flag for having shown the warning about divxs invalid b frames
+/// flag for having shown the warning about invalid Divx B-frames
 int showed_packed_warning;
-int vol_control_parameters; /**< does the stream contain the low_delay 
flag,
- *   used to work around buggy encoders. */
-
+/** does the stream contain the low_delay flag,
+ *  used to work around buggy encoders. */
+int vol_control_parameters;
 int cplx_estimation_trash_i;
 int cplx_estimation_trash_p;
 int cplx_estimation_trash_b;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '93f29948e4b06acfb96e7f82d373ef86d6dc55f7'

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
12:50:40 2014 +0200| [b634c12cb9673428672aa0fb216e866709451e61] | committer: 
Michael Niedermayer

Merge commit '93f29948e4b06acfb96e7f82d373ef86d6dc55f7'

* commit '93f29948e4b06acfb96e7f82d373ef86d6dc55f7':
  mpeg4video: Fix doxygen comment syntax to document correct struct member

Conflicts:
libavcodec/mpeg4video.h

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b634c12cb9673428672aa0fb216e866709451e61
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] dpx: use aligned line starts

2014-08-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Wed Aug 13 00:37:00 2014 +0200| [4ba45c189ccafdedcdb703e40441fbd24fe62989] | 
committer: Michael Niedermayer

dpx: use aligned line starts

SMPTE 268M-2003 specifies that each line starts at a 4-bytes boundary.
Therefore, modify correspondingly the input buffer strides and size.

Partially fixes ticket #3692: DLAD_8b_3c_big.dpx still has inverted
colors, which might be related to endianness.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ba45c189ccafdedcdb703e40441fbd24fe62989
---

 libavcodec/dpx.c |   42 ++
 1 file changed, 30 insertions(+), 12 deletions(-)

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index d8fb4e0..5d8c4f3 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -77,9 +77,9 @@ static int decode_frame(AVCodecContext *avctx,
 
 unsigned int offset;
 int magic_num, endian;
-int x, y, i, ret;
-int w, h, bits_per_color, descriptor, elements, packing, total_size;
-int encoding;
+int x, y, stride, i, ret;
+int w, h, bits_per_color, descriptor, elements, packing;
+int encoding, need_align = 0;
 
 unsigned int rgbBuffer = 0;
 int n_datum = 0;
@@ -185,24 +185,24 @@ static int decode_frame(AVCodecContext *avctx,
 
 switch (bits_per_color) {
 case 8:
-total_size = avctx->width * avctx->height * elements;
+stride = avctx->width * elements;
 break;
 case 10:
 if (!packing) {
 av_log(avctx, AV_LOG_ERROR, "Packing to 32bit required\n");
 return -1;
 }
-total_size = (avctx->width * elements + 2) / 3 * 4 * avctx->height;
+stride = (avctx->width * elements + 2) / 3 * 4;
 break;
 case 12:
 if (!packing) {
 av_log(avctx, AV_LOG_ERROR, "Packing to 16bit required\n");
 return -1;
 }
-total_size = 2 * avctx->width * avctx->height * elements;
+stride = 2 * avctx->width * elements;
 break;
 case 16:
-total_size = 2 * avctx->width * avctx->height * elements;
+stride = 2 * avctx->width * elements;
 break;
 case 1:
 case 32:
@@ -213,6 +213,26 @@ static int decode_frame(AVCodecContext *avctx,
 return AVERROR_INVALIDDATA;
 }
 
+// Table 3c: Runs will always break at scan line boundaries. Packing
+// will always break to the next 32-bit word at scan-line boundaries.
+// Unfortunately, the encoder produced invalid files, so attempt
+// to detect it
+need_align = FFALIGN(stride, 4);
+if (need_align*avctx->height + (int64_t)offset > avpkt->size) {
+// Alignment seems unappliable, try without
+if (stride*avctx->height + (int64_t)offset > avpkt->size) {
+av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid header?\n");
+return AVERROR_INVALIDDATA;
+} else {
+av_log(avctx, AV_LOG_INFO, "Decoding DPX without scanline "
+   "alignment.\n");
+need_align = 0;
+}
+} else {
+need_align -= stride;
+stride = FFALIGN(stride, 4);
+}
+
 switch (1000 * descriptor + 10 * bits_per_color + endian) {
 case 6081:
 case 6080:
@@ -276,10 +296,6 @@ static int decode_frame(AVCodecContext *avctx,
 for (i=0; idata[i];
 
-if (total_size + (int64_t)offset > avpkt->size) {
-av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid header?\n");
-return AVERROR_INVALIDDATA;
-}
 switch (bits_per_color) {
 case 10:
 for (x = 0; x < avctx->height; x++) {
@@ -318,6 +334,8 @@ static int decode_frame(AVCodecContext *avctx,
 // For 12 bit, ignore alpha
 if (elements == 4)
 buf += 2;
+// Jump to next aligned position
+buf += need_align;
 }
 for (i = 0; i < 3; i++)
 ptr[i] += p->linesize[i];
@@ -327,7 +345,7 @@ static int decode_frame(AVCodecContext *avctx,
 elements *= 2;
 case 8:
 av_image_copy_plane(ptr[0], p->linesize[0],
-buf, elements * avctx->width,
+buf, stride,
 elements * avctx->width, avctx->height);
 break;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/lcldec: initialize encoded correctly

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
15:18:49 2014 +0200| [6c36b3afe72d1ab635efba36e78c849630ed9ec6] | committer: 
Michael Niedermayer

avcodec/lcldec: initialize encoded correctly

Fixes out of array read
Fixes: yuv111_no_compr_crash.avi

Found-by: Piotr Bandurski 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6c36b3afe72d1ab635efba36e78c849630ed9ec6
---

 libavcodec/lcldec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c
index bfab58c..60069d4 100644
--- a/libavcodec/lcldec.c
+++ b/libavcodec/lcldec.c
@@ -171,7 +171,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 LclDecContext * const c = avctx->priv_data;
 unsigned int pixel_ptr;
 int row, col;
-unsigned char *encoded, *outptr;
+unsigned char *encoded = avpkt->data, *outptr;
 uint8_t *y_out, *u_out, *v_out;
 unsigned int width = avctx->width; // Real image width
 unsigned int height = avctx->height; // Real image height

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] proresenc_kostya: properly account for alpha

2014-08-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Mon Aug 11 19:43:27 2014 +0200| [117bc8e6ffc744fedcf77edf2fdb33c964b83370] | 
committer: Michael Niedermayer

proresenc_kostya: properly account for alpha

The packet buffer allocation considered as dct-coded, while it is
actually run-coded and thus requires a larger buffer.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=117bc8e6ffc744fedcf77edf2fdb33c964b83370
---

 libavcodec/proresenc_kostya.c |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index a70ae3c..c3c2363 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1208,8 +1208,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
 ctx->bits_per_mb = ls * 8;
 if (ctx->chroma_factor == CFACTOR_Y444)
 ctx->bits_per_mb += ls * 4;
-if (ctx->num_planes == 4)
-ctx->bits_per_mb += ls * 4;
 }
 
 ctx->frame_size_upper_bound = ctx->pictures_per_frame *
@@ -1218,6 +1216,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
(mps * ctx->bits_per_mb) / 8)
   + 200;
 
+if (ctx->alpha_bits) {
+ // alpha plane is run-coded and might run over bit budget
+ ctx->frame_size_upper_bound += ctx->pictures_per_frame *
+ctx->slices_per_picture *
+ /* num pixels per slice */ (ctx->mbs_per_slice * 256 *
+ /* bits per pixel */(1 + ctx->alpha_bits + 1) + 7 >> 3);
+}
+
 avctx->codec_tag   = ctx->profile_info->tag;
 
 av_log(avctx, AV_LOG_DEBUG,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/mjpegdec: Support AV_PIX_FMT_YUV420P16 with upscale_h

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
16:19:53 2014 +0200| [5c7899a4834ee927f5629e4c02bfa225b846f016] | committer: 
Michael Niedermayer

avcodec/mjpegdec: Support AV_PIX_FMT_YUV420P16 with upscale_h

Fixes assertion failure
Fixes: test42f.jpg
Found-by: Piotr Bandurski 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c7899a4834ee927f5629e4c02bfa225b846f016
---

 libavcodec/mjpegdec.c |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index ea84d9a..b6e0e68 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1895,6 +1895,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 int start_code;
 int i, index;
 int ret = 0;
+int is16bit;
 
 av_dict_free(&s->exif_metadata);
 av_freep(&s->stereo3d);
@@ -2073,6 +2074,9 @@ fail:
 s->got_picture = 0;
 return ret;
 the_end:
+
+is16bit = av_pix_fmt_desc_get(s->avctx->pix_fmt)->comp[0].step_minus1;
+
 if (s->upscale_h) {
 int p;
 av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
@@ -2082,6 +2086,7 @@ the_end:
avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV420P  ||
+   avctx->pix_fmt == AV_PIX_FMT_YUV420P16||
avctx->pix_fmt == AV_PIX_FMT_GBRAP
   );
 avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
@@ -2093,8 +2098,12 @@ the_end:
 if (p==1 || p==2)
 w >>= hshift;
 for (i = 0; i < s->chroma_height; i++) {
-for (index = w - 1; index; index--)
-line[index] = (line[index / 2] + line[(index + 1) / 2]) >> 
1;
+for (index = w - 1; index; index--) {
+if (is16bit)
+((uint16_t*)line)[index] = (((uint16_t*)line)[index / 
2] + ((uint16_t*)line)[(index + 1) / 2]) >> 1;
+else
+line[index] = (line[index / 2] + line[(index + 1) / 
2]) >> 1;
+}
 line += s->linesize[p];
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] libavcodec: bump micro to reflect dpx changes

2014-08-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Thu Aug 14 14:05:19 2014 +0200| [58d380f9a7ce323d34976ef3720e3d19ca107112] | 
committer: Michael Niedermayer

libavcodec: bump micro to reflect dpx changes

The encoder produces files that are no longer compatible with previous
versions of the decoder, and may actually cause decoding issues for other
software, so indicate that change to allow decoder quirks.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58d380f9a7ce323d34976ef3720e3d19ca107112
---

 libavcodec/version.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/version.h b/libavcodec/version.h
index 5769afa..2c871ba 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 56
 #define LIBAVCODEC_VERSION_MINOR  0
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avfilter/select: re-align a few comments

2014-08-14 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Thu Aug 14 18:52:47 
2014 +0200| [10d96d8d66b8db8df28fd0cd826a8e320a2e84cd] | committer: Clément 
Bœsch

avfilter/select: re-align a few comments

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10d96d8d66b8db8df28fd0cd826a8e320a2e84cd
---

 libavfilter/f_select.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index a06ca87..bb3eb65 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -142,8 +142,8 @@ typedef struct SelectContext {
 double var_values[VAR_VARS_NB];
 int do_scene_detect;///< 1 if the expression requires scene 
detection variables, 0 otherwise
 av_pixelutils_sad_fn sad;   ///< Sum of the absolute difference 
function (scene detect only)
-double prev_mafd;   ///< previous MAFD 
(scene detect only)
-AVFrame *prev_picref; ///< previous frame
(scene detect only)
+double prev_mafd;   ///< previous MAFD 
  (scene detect only)
+AVFrame *prev_picref;   ///< previous frame
  (scene detect only)
 double select;
 int select_out; ///< mark the selected output pad index
 int nb_outputs;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avfilter/select: larger pixel sad computation

2014-08-14 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Thu Aug 14 18:56:10 
2014 +0200| [37bfeca78cf3e00934427e59350441ca097de84c] | committer: Clément 
Bœsch

avfilter/select: larger pixel sad computation

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=37bfeca78cf3e00934427e59350441ca097de84c
---

 libavfilter/f_select.c |4 ++--
 tests/ref/fate/filter-metadata-scenedetect |8 
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index bb3eb65..546a940 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -259,8 +259,8 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame 
*frame)
 const int p1_linesize =   frame->linesize[0];
 const int p2_linesize = prev_picref->linesize[0];
 
-for (y = 0; y < frame->height - 8; y += 8) {
-for (x = 0; x < frame->width*3 - 8; x += 8) {
+for (y = 0; y < frame->height - 7; y += 8) {
+for (x = 0; x < frame->width*3 - 7; x += 8) {
 sad += select->sad(p1 + x, p1_linesize, p2 + x, p2_linesize);
 nb_sad += 8 * 8;
 }
diff --git a/tests/ref/fate/filter-metadata-scenedetect 
b/tests/ref/fate/filter-metadata-scenedetect
index 4e70723..d04054a 100644
--- a/tests/ref/fate/filter-metadata-scenedetect
+++ b/tests/ref/fate/filter-metadata-scenedetect
@@ -1,10 +1,10 @@
 pkt_pts=1620|tag:lavfi.scene_score=1.00
-pkt_pts=4140|tag:lavfi.scene_score=0.876043
+pkt_pts=4140|tag:lavfi.scene_score=0.875036
 pkt_pts=5800|tag:lavfi.scene_score=1.00
-pkt_pts=6720|tag:lavfi.scene_score=0.463259
+pkt_pts=6720|tag:lavfi.scene_score=0.461625
 pkt_pts=8160|tag:lavfi.scene_score=1.00
 pkt_pts=9760|tag:lavfi.scene_score=1.00
-pkt_pts=14080|tag:lavfi.scene_score=0.841420
+pkt_pts=14080|tag:lavfi.scene_score=0.838916
 pkt_pts=15700|tag:lavfi.scene_score=1.00
-pkt_pts=18500|tag:lavfi.scene_score=0.471738
+pkt_pts=18500|tag:lavfi.scene_score=0.474948
 pkt_pts=21760|tag:lavfi.scene_score=1.00

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavfi/avf_showspectrum: do not push the frame at EOF.

2014-08-14 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Sun Aug  3 
16:40:54 2014 +0200| [d4de6d4fadcc70fb96ba0f3793e7ebaf4ddc3da9] | committer: 
Nicolas George

lavfi/avf_showspectrum: do not push the frame at EOF.

It is always identical to the last pushed frame.
The samples in the last incomplete window were ignored,
this is unchanged.
Possible enhancement: pad the last incomplete window with
silence.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d4de6d4fadcc70fb96ba0f3793e7ebaf4ddc3da9
---

 libavfilter/avf_showspectrum.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 28db8b1..e925556 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -281,8 +281,6 @@ static int request_frame(AVFilterLink *outlink)
 ret = ff_request_frame(inlink);
 } while (!s->req_fullfilled && ret >= 0);
 
-if (ret == AVERROR_EOF && s->outpicref)
-push_frame(outlink);
 return ret;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavfi/avf_showspectrum: set output frame rate.

2014-08-14 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Sun Aug  3 
16:23:18 2014 +0200| [a3aaaec8916b8fae810ad35ff3ca299336f0bda0] | committer: 
Nicolas George

lavfi/avf_showspectrum: set output frame rate.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a3aaaec8916b8fae810ad35ff3ca299336f0bda0
---

 libavfilter/avf_showspectrum.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 4a4b4f4..e3ae6ea 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -246,6 +246,8 @@ static int config_output(AVFilterLink *outlink)
 if (s->xpos >= outlink->w)
 s->xpos = 0;
 
+outlink->frame_rate = av_make_q(inlink->sample_rate, win_size);
+
 s->combine_buffer =
 av_realloc_f(s->combine_buffer, outlink->h * 3,
  sizeof(*s->combine_buffer));

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavfi/avf_showspectrum: add full frame sliding mode.

2014-08-14 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Sun Aug  3 
19:30:04 2014 +0200| [7c10e32ae5a1e6e1ab654c5f84a0522500de773d] | committer: 
Nicolas George

lavfi/avf_showspectrum: add full frame sliding mode.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c10e32ae5a1e6e1ab654c5f84a0522500de773d
---

 doc/filters.texi   |   15 ++--
 libavfilter/avf_showspectrum.c |   50 +---
 2 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index a3e4d81..0ca1d6f 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10687,8 +10687,19 @@ the "Video size" section in the ffmpeg-utils manual. 
Default value is
 @code{640x512}.
 
 @item slide
-Specify if the spectrum should slide along the window. Default value is
-@code{0}.
+Specify how the spectrum should slide along the window.
+
+It accepts the following values:
+@table @samp
+@item replace
+the samples start again on the left when they reach the right
+@item scroll
+the samples scroll from right to left
+@item fullframe
+frames are only produced when the samples reach the right
+@end table
+
+Default value is @code{replace}.
 
 @item mode
 Specify display mode.
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 5a4ab27..9130f6f 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -38,6 +38,7 @@ enum DisplayMode  { COMBINED, SEPARATE, NB_MODES };
 enum DisplayScale { LINEAR, SQRT, CBRT, LOG, NB_SCALES };
 enum ColorMode{ CHANNEL, INTENSITY, NB_CLMODES };
 enum WindowFunc   { WFUNC_NONE, WFUNC_HANN, WFUNC_HAMMING, WFUNC_BLACKMAN, 
NB_WFUNC };
+enum SlideMode{ REPLACE, SCROLL, FULLFRAME, NB_SLIDES };
 
 typedef struct {
 const AVClass *class;
@@ -66,7 +67,10 @@ typedef struct {
 static const AVOption showspectrum_options[] = {
 { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = 
"640x512"}, 0, 0, FLAGS },
 { "s","set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = 
"640x512"}, 0, 0, FLAGS },
-{ "slide", "set sliding mode", OFFSET(sliding), AV_OPT_TYPE_INT, {.i64 = 
0}, 0, 1, FLAGS },
+{ "slide", "set sliding mode", OFFSET(sliding), AV_OPT_TYPE_INT, {.i64 = 
0}, 0, NB_SLIDES, FLAGS, "slide" },
+{ "replace", "replace old colums with new", 0, AV_OPT_TYPE_CONST, 
{.i64=REPLACE}, 0, 0, FLAGS, "slide" },
+{ "scroll", "scroll from right to left", 0, AV_OPT_TYPE_CONST, 
{.i64=SCROLL}, 0, 0, FLAGS, "slide" },
+{ "fullframe", "return full frames", 0, AV_OPT_TYPE_CONST, 
{.i64=FULLFRAME}, 0, 0, FLAGS, "slide" },
 { "mode", "set channel display mode", OFFSET(mode), AV_OPT_TYPE_INT, 
{.i64=COMBINED}, COMBINED, NB_MODES-1, FLAGS, "mode" },
 { "combined", "combined mode", 0, AV_OPT_TYPE_CONST, {.i64=COMBINED}, 
0, 0, FLAGS, "mode" },
 { "separate", "separate mode", 0, AV_OPT_TYPE_CONST, {.i64=SEPARATE}, 
0, 0, FLAGS, "mode" },
@@ -244,6 +248,8 @@ static int config_output(AVFilterLink *outlink)
 s->xpos = 0;
 
 outlink->frame_rate = av_make_q(inlink->sample_rate, win_size);
+if (s->sliding == FULLFRAME)
+outlink->frame_rate.den *= outlink->w;
 
 inlink->min_samples = inlink->max_samples = inlink->partial_buf_size =
 win_size;
@@ -257,27 +263,27 @@ static int config_output(AVFilterLink *outlink)
 return 0;
 }
 
-inline static int push_frame(AVFilterLink *outlink)
-{
-ShowSpectrumContext *s = outlink->src->priv;
-
-s->xpos++;
-if (s->xpos >= outlink->w)
-s->xpos = 0;
-s->req_fullfilled = 1;
-
-return ff_filter_frame(outlink, av_frame_clone(s->outpicref));
-}
-
 static int request_frame(AVFilterLink *outlink)
 {
 ShowSpectrumContext *s = outlink->src->priv;
 AVFilterLink *inlink = outlink->src->inputs[0];
+unsigned i;
 int ret;
 
 s->req_fullfilled = 0;
 do {
 ret = ff_request_frame(inlink);
+if (ret == AVERROR_EOF && s->sliding == FULLFRAME && s->xpos > 0 &&
+s->outpicref) {
+for (i = 0; i < outlink->h; i++) {
+memset(s->outpicref->data[0] + i * s->outpicref->linesize[0] + 
s->xpos,   0, outlink->w - s->xpos);
+memset(s->outpicref->data[1] + i * s->outpicref->linesize[1] + 
s->xpos, 128, outlink->w - s->xpos);
+memset(s->outpicref->data[2] + i * s->outpicref->linesize[2] + 
s->xpos, 128, outlink->w - s->xpos);
+}
+ret = ff_filter_frame(outlink, s->outpicref);
+s->outpicref = NULL;
+s->req_fullfilled = 1;
+}
 } while (!s->req_fullfilled && ret >= 0);
 
 return ret;
@@ -439,7 +445,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, 
AVFrame *insamples)
 }
 
 /* copy to output */
-if (s->sliding) {
+if (s->sliding == SCROLL) {
 for (plane = 0; plane < 3; plane++) {
 for (y = 0; y < outlink->h; y++) {
  

[FFmpeg-cvslog] Merge remote-tracking branch 'cigaes/master'

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
19:42:34 2014 +0200| [c6c345ea928bafc4097a1b99a8ce18556a38473e] | committer: 
Michael Niedermayer

Merge remote-tracking branch 'cigaes/master'

* cigaes/master:
  lavfi/avf_showspectrum: check RDFT context init.
  lavfi/avf_showspectrum: add full frame sliding mode.
  lavfi/avf_showspectrum: use automatic framing.
  lavfi/avf_showspectrum: do not push the frame at EOF.
  lavfi/avf_showspectrum: fix output pts computation.
  lavfi/avf_showspectrum: set output frame rate.

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6c345ea928bafc4097a1b99a8ce18556a38473e
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavfi/avf_showspectrum: fix output pts computation.

2014-08-14 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Sun Aug  3 
16:23:37 2014 +0200| [65b284a4aef68fc88c80d970a41339113293dc18] | committer: 
Nicolas George

lavfi/avf_showspectrum: fix output pts computation.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65b284a4aef68fc88c80d970a41339113293dc18
---

 libavfilter/avf_showspectrum.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index e3ae6ea..28db8b1 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -468,7 +468,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, 
AVFrame *insamples, int nb
 }
 
 outpicref->pts = insamples->pts +
-av_rescale_q(s->consumed,
+av_rescale_q(s->consumed + add_samples - win_size,
  (AVRational){ 1, inlink->sample_rate },
  outlink->time_base);
 ret = push_frame(outlink);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavfi/avf_showspectrum: use automatic framing.

2014-08-14 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Sun Aug  3 
16:58:27 2014 +0200| [ec33df60457d95e174c51666cb799e48c55facb0] | committer: 
Nicolas George

lavfi/avf_showspectrum: use automatic framing.

The framework can ensure that each input frame has exactly
the correct number of samples, except the last one.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec33df60457d95e174c51666cb799e48c55facb0
---

 libavfilter/avf_showspectrum.c |   48 ++--
 1 file changed, 17 insertions(+), 31 deletions(-)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index e925556..5a4ab27 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -55,8 +55,6 @@ typedef struct {
 RDFTContext *rdft;  ///< Real Discrete Fourier Transform context
 int rdft_bits;  ///< number of bits (RDFT window size = 
1filled = 0;
 
 /* pre-calc windowing function */
 s->window_func_lut =
@@ -248,6 +245,9 @@ static int config_output(AVFilterLink *outlink)
 
 outlink->frame_rate = av_make_q(inlink->sample_rate, win_size);
 
+inlink->min_samples = inlink->max_samples = inlink->partial_buf_size =
+win_size;
+
 s->combine_buffer =
 av_realloc_f(s->combine_buffer, outlink->h * 3,
  sizeof(*s->combine_buffer));
@@ -264,7 +264,6 @@ inline static int push_frame(AVFilterLink *outlink)
 s->xpos++;
 if (s->xpos >= outlink->w)
 s->xpos = 0;
-s->filled = 0;
 s->req_fullfilled = 1;
 
 return ff_filter_frame(outlink, av_frame_clone(s->outpicref));
@@ -284,7 +283,7 @@ static int request_frame(AVFilterLink *outlink)
 return ret;
 }
 
-static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples, int 
nb_samples)
+static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
 {
 int ret;
 AVFilterContext *ctx = inlink->dst;
@@ -297,26 +296,21 @@ static int plot_spectrum_column(AVFilterLink *inlink, 
AVFrame *insamples, int nb
 const int nb_freq = 1 << (s->rdft_bits - 1);
 const int win_size = nb_freq << 1;
 const double w = 1. / (sqrt(nb_freq) * 32768.);
+int h = s->channel_height;
 
 int ch, plane, n, y;
-const int start = s->filled;
-const int add_samples = FFMIN(win_size - start, nb_samples);
+
+av_assert0(insamples->nb_samples == win_size);
 
 /* fill RDFT input with the number of samples available */
 for (ch = 0; ch < s->nb_display_channels; ch++) {
 const int16_t *p = (int16_t *)insamples->extended_data[ch];
 
-p += s->consumed;
-for (n = 0; n < add_samples; n++)
-s->rdft_data[ch][start + n] = p[n] * s->window_func_lut[start + n];
+for (n = 0; n < win_size; n++)
+s->rdft_data[ch][n] = p[n] * s->window_func_lut[n];
 }
-s->filled += add_samples;
 
-/* complete RDFT window size? */
-if (s->filled == win_size) {
-
-/* channel height */
-int h = s->channel_height;
+/* TODO reindent */
 
 /* run RDFT on each samples set */
 for (ch = 0; ch < s->nb_display_channels; ch++)
@@ -465,32 +459,24 @@ static int plot_spectrum_column(AVFilterLink *inlink, 
AVFrame *insamples, int nb
 }
 }
 
-outpicref->pts = insamples->pts +
-av_rescale_q(s->consumed + add_samples - win_size,
- (AVRational){ 1, inlink->sample_rate },
- outlink->time_base);
+outpicref->pts = insamples->pts;
 ret = push_frame(outlink);
 if (ret < 0)
 return ret;
-}
 
-return add_samples;
+return win_size;
 }
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
 {
 AVFilterContext *ctx = inlink->dst;
 ShowSpectrumContext *s = ctx->priv;
-int ret = 0, left_samples = insamples->nb_samples;
+unsigned win_size = 1 << s->rdft_bits;
+int ret = 0;
 
-s->consumed = 0;
-while (left_samples) {
-int ret = plot_spectrum_column(inlink, insamples, left_samples);
-if (ret < 0)
-break;
-s->consumed += ret;
-left_samples -= ret;
-}
+av_assert0(insamples->nb_samples <= win_size);
+if (insamples->nb_samples == win_size)
+ret = plot_spectrum_column(inlink, insamples);
 
 av_frame_free(&insamples);
 return ret;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavfi/avf_showspectrum: check RDFT context init.

2014-08-14 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Sun Aug  3 
20:39:59 2014 +0200| [638eec2ac34b7f65a8e84203ea4292440bc8fe50] | committer: 
Nicolas George

lavfi/avf_showspectrum: check RDFT context init.

Fix a segfault with large window size.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=638eec2ac34b7f65a8e84203ea4292440bc8fe50
---

 libavfilter/avf_showspectrum.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 9130f6f..bd4d818 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -177,6 +177,11 @@ static int config_output(AVFilterLink *outlink)
 
 av_rdft_end(s->rdft);
 s->rdft = av_rdft_init(rdft_bits, DFT_R2C);
+if (!s->rdft) {
+av_log(ctx, AV_LOG_ERROR, "Unable to create RDFT context. "
+   "The window size might be too high.\n");
+return AVERROR(EINVAL);
+}
 s->rdft_bits = rdft_bits;
 
 /* RDFT buffers: x2 for each (display) channel buffer.

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavc/flacdsp: change lpc_encoder function pointer prototype

2014-08-14 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Thu Aug 14 
17:14:15 2014 +0200| [7ce6c021dc471c00aaff4f2245424bcb524374c8] | committer: 
Michael Niedermayer

lavc/flacdsp: change lpc_encoder function pointer prototype

This should help to clarify the API.

Reviewed-by: Christophe Gisquet 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ce6c021dc471c00aaff4f2245424bcb524374c8
---

 libavcodec/flacdsp.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/flacdsp.h b/libavcodec/flacdsp.h
index 272cf2a..14f3466 100644
--- a/libavcodec/flacdsp.h
+++ b/libavcodec/flacdsp.h
@@ -28,7 +28,7 @@ typedef struct FLACDSPContext {
 void (*lpc)(int32_t *samples, const int coeffs[32], int order,
 int qlevel, int len);
 void (*lpc_encode)(int32_t *res, const int32_t *smp, int len, int order,
-   const int32_t *coefs, int shift);
+   const int32_t coefs[32], int shift);
 } FLACDSPContext;
 
 void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int bps);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avutil/opt: remove disabled old ABI compatibility code

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
20:42:53 2014 +0200| [8b6cbc3c3319f7942d679d6f6319971c102cfbd3] | committer: 
Michael Niedermayer

avutil/opt: remove disabled old ABI compatibility code

Fixes some unused variable warnings

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8b6cbc3c3319f7942d679d6f6319971c102cfbd3
---

 libavutil/opt.c |   29 +
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index fec840b..a467977 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -583,7 +583,6 @@ static int set_format(void *obj, const char *name, int fmt, 
int search_flags,
 const AVOption *o = av_opt_find2(obj, name, NULL, 0,
  search_flags, &target_obj);
 int min, max;
-const AVClass *class = *(AVClass **)obj;
 
 if (!o || !target_obj)
 return AVERROR_OPTION_NOT_FOUND;
@@ -593,16 +592,9 @@ static int set_format(void *obj, const char *name, int 
fmt, int search_flags,
 return AVERROR(EINVAL);
 }
 
-#if LIBAVUTIL_VERSION_MAJOR < 54
-if (class->version && class->version < AV_VERSION_INT(52, 11, 100)) {
-min = -1;
-max = nb_fmts-1;
-} else
-#endif
-{
-min = FFMAX(o->min, -1);
-max = FFMIN(o->max, nb_fmts-1);
-}
+min = FFMAX(o->min, -1);
+max = FFMIN(o->max, nb_fmts-1);
+
 if (fmt < min || fmt > max) {
 av_log(obj, AV_LOG_ERROR,
"Value %d for parameter '%s' out of %s format range [%d - 
%d]\n",
@@ -1190,7 +1182,6 @@ void av_opt_set_defaults(void *s)
 void av_opt_set_defaults2(void *s, int mask, int flags)
 {
 #endif
-const AVClass *class = *(AVClass **)s;
 const AVOption *opt = NULL;
 while ((opt = av_opt_next(s, opt)) != NULL) {
 void *dst = ((uint8_t*)s) + opt->offset;
@@ -1239,20 +1230,10 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
 set_string_video_rate(s, opt, opt->default_val.str, dst);
 break;
 case AV_OPT_TYPE_PIXEL_FMT:
-#if LIBAVUTIL_VERSION_MAJOR < 54
-if (class->version && class->version < AV_VERSION_INT(52, 10, 
100))
-av_opt_set(s, opt->name, opt->default_val.str, 0);
-else
-#endif
-write_number(s, opt, dst, 1, 1, opt->default_val.i64);
+write_number(s, opt, dst, 1, 1, opt->default_val.i64);
 break;
 case AV_OPT_TYPE_SAMPLE_FMT:
-#if LIBAVUTIL_VERSION_MAJOR < 54
-if (class->version && class->version < AV_VERSION_INT(52, 10, 
100))
-av_opt_set(s, opt->name, opt->default_val.str, 0);
-else
-#endif
-write_number(s, opt, dst, 1, 1, opt->default_val.i64);
+write_number(s, opt, dst, 1, 1, opt->default_val.i64);
 break;
 case AV_OPT_TYPE_BINARY:
 case AV_OPT_TYPE_DICT:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/format: remove unused variable

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu Aug 14 
20:40:11 2014 +0200| [fce8817a01d15f1e740303b7c1a5a73a2986a6de] | committer: 
Michael Niedermayer

avformat/format: remove unused variable

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fce8817a01d15f1e740303b7c1a5a73a2986a6de
---

 libavformat/format.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/libavformat/format.c b/libavformat/format.c
index 999e821..828ab52 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -254,7 +254,6 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat 
**fmt,
 {
 AVProbeData pd = { filename ? filename : "" };
 uint8_t *buf = NULL;
-uint8_t *mime_type;
 int ret = 0, probe_size, buf_offset = 0;
 int score = 0;
 int ret2;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] idct: remove call to ff_idctdsp_init from ff_MPV_common_init

2014-08-14 Thread John Stebbins
ffmpeg | branch: master | John Stebbins  | Fri Aug  8 
08:11:20 2014 -0700| [998c9f15d1ca8c7489775ebcca51623b915988f1] | committer: 
John Stebbins

idct: remove call to ff_idctdsp_init from ff_MPV_common_init

One step in untangling the mpegvideo code and fixing some problems in
the order that initialization is being done in h263dec and h261dec.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=998c9f15d1ca8c7489775ebcca51623b915988f1
---

 libavcodec/dnxhdenc.c  |3 +--
 libavcodec/h261dec.c   |4 +++-
 libavcodec/h263dec.c   |8 ++--
 libavcodec/mpeg12dec.c |   12 ++--
 libavcodec/mpegvideo.c |   15 ++-
 libavcodec/mpegvideo.h |2 +-
 libavcodec/mpegvideo_enc.c |1 +
 libavcodec/rv10.c  |1 +
 libavcodec/rv34.c  |2 ++
 9 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index e656b6e..4294510 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -309,10 +309,9 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
 
 ff_blockdsp_init(&ctx->bdsp, avctx);
 ff_fdctdsp_init(&ctx->m.fdsp, avctx);
-ff_idctdsp_init(&ctx->m.idsp, avctx);
+ff_mpv_idct_init(&ctx->m);
 ff_mpegvideoencdsp_init(&ctx->m.mpvencdsp, avctx);
 ff_pixblockdsp_init(&ctx->m.pdsp, avctx);
-ff_dct_common_init(&ctx->m);
 if (!ctx->m.dct_quantize)
 ctx->m.dct_quantize = ff_dct_quantize_c;
 
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index d83fb31..88ca63d 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -581,10 +581,12 @@ static int h261_decode_frame(AVCodecContext *avctx, void 
*data,
 retry:
 init_get_bits(&s->gb, buf, buf_size * 8);
 
-if (!s->context_initialized)
+if (!s->context_initialized) {
 // we need the IDCT permutaton for reading a custom matrix
+ff_mpv_idct_init(s);
 if (ff_MPV_common_init(s) < 0)
 return -1;
+}
 
 ret = h261_decode_picture_header(h);
 
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index cdd5544..a6d16b7 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -113,9 +113,11 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
 
 /* for h263, we allocate the images after having read the header */
 if (avctx->codec->id != AV_CODEC_ID_H263 &&
-avctx->codec->id != AV_CODEC_ID_MPEG4)
+avctx->codec->id != AV_CODEC_ID_MPEG4) {
+ff_mpv_idct_init(s);
 if ((ret = ff_MPV_common_init(s)) < 0)
 return ret;
+}
 
 ff_h263dsp_init(&s->h263dsp);
 ff_qpeldsp_init(&s->qdsp);
@@ -414,10 +416,12 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 if (ret < 0)
 return ret;
 
-if (!s->context_initialized)
+if (!s->context_initialized) {
 // we need the idct permutaton for reading a custom matrix
+ff_mpv_idct_init(s);
 if ((ret = ff_MPV_common_init(s)) < 0)
 return ret;
+}
 
 /* We need to set current_picture_ptr before reading the header,
  * otherwise we cannot store anyting in there */
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index a181fcc..29f8980 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1097,18 +1097,16 @@ static av_cold int mpeg_decode_init(AVCodecContext 
*avctx)
 {
 Mpeg1Context *s= avctx->priv_data;
 MpegEncContext *s2 = &s->mpeg_enc_ctx;
-int i;
-
-/* we need some permutation to store matrices,
- * until MPV_common_init() sets the real permutation. */
-for (i = 0; i < 64; i++)
-s2->idsp.idct_permutation[i] = i;
 
 ff_MPV_decode_defaults(s2);
 
 s->mpeg_enc_ctx.avctx  = avctx;
 s->mpeg_enc_ctx.flags  = avctx->flags;
 s->mpeg_enc_ctx.flags2 = avctx->flags2;
+
+/* we need some permutation to store matrices,
+ * until the decoder sets the real permutation. */
+ff_mpv_idct_init(s2);
 ff_mpeg12_common_init(&s->mpeg_enc_ctx);
 ff_mpeg12_init_vlcs();
 
@@ -1313,6 +1311,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
  * if DCT permutation is changed. */
 memcpy(old_permutation, s->idsp.idct_permutation, 64 * 
sizeof(uint8_t));
 
+ff_mpv_idct_init(s);
 if (ff_MPV_common_init(s) < 0)
 return -2;
 
@@ -2151,6 +2150,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
 #endif /* FF_API_XVMC */
 avctx->idct_algo = FF_IDCT_SIMPLE;
 
+ff_mpv_idct_init(s);
 if (ff_MPV_common_init(s) < 0)
 return -1;
 s1->mpeg_enc_ctx_allocated = 1;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index da42541..540c959 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -375,11 +375,10 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int 
mv_dir, int mv_type,
 }
 
 /* init common dct for both encoder and decoder */
-av_cold int ff_dct_common_init

[FFmpeg-cvslog] Merge commit '998c9f15d1ca8c7489775ebcca51623b915988f1'

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Aug 15 
02:08:59 2014 +0200| [2fd87a3d7895ce36e558a306d03e33697d456086] | committer: 
Michael Niedermayer

Merge commit '998c9f15d1ca8c7489775ebcca51623b915988f1'

* commit '998c9f15d1ca8c7489775ebcca51623b915988f1':
  idct: remove call to ff_idctdsp_init from ff_MPV_common_init

Conflicts:
libavcodec/dnxhdenc.c
libavcodec/h263dec.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo.h

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2fd87a3d7895ce36e558a306d03e33697d456086
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'b869eea7ea8f5d8331fcd6355f848bb6a6e06b14'

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Aug 15 
02:27:03 2014 +0200| [012062cfd51f50862d18eeb35e316866932cfd0e] | committer: 
Michael Niedermayer

Merge commit 'b869eea7ea8f5d8331fcd6355f848bb6a6e06b14'

* commit 'b869eea7ea8f5d8331fcd6355f848bb6a6e06b14':
  h263dec: Fix order of initialization

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=012062cfd51f50862d18eeb35e316866932cfd0e
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] h263dec: Fix order of initialization

2014-08-14 Thread John Stebbins
ffmpeg | branch: master | John Stebbins  | Fri Aug  8 
08:21:02 2014 -0700| [b869eea7ea8f5d8331fcd6355f848bb6a6e06b14] | committer: 
John Stebbins

h263dec: Fix order of initialization

ff_MPV_common_init requires the frame dimensions which get parsed in
*_decode_picture_header.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b869eea7ea8f5d8331fcd6355f848bb6a6e06b14
---

 libavcodec/h263dec.c |   25 -
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index a6d16b7..c4db99e 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -416,21 +416,9 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 if (ret < 0)
 return ret;
 
-if (!s->context_initialized) {
+if (!s->context_initialized)
 // we need the idct permutaton for reading a custom matrix
 ff_mpv_idct_init(s);
-if ((ret = ff_MPV_common_init(s)) < 0)
-return ret;
-}
-
-/* We need to set current_picture_ptr before reading the header,
- * otherwise we cannot store anyting in there */
-if (s->current_picture_ptr == NULL || s->current_picture_ptr->f->data[0]) {
-int i = ff_find_unused_picture(s, 0);
-if (i < 0)
-return i;
-s->current_picture_ptr = &s->picture[i];
-}
 
 /* let's go :-) */
 if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
@@ -465,6 +453,17 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 return ret;
 }
 
+if (!s->context_initialized)
+if ((ret = ff_MPV_common_init(s)) < 0)
+return ret;
+
+if (s->current_picture_ptr == NULL || s->current_picture_ptr->f->data[0]) {
+int i = ff_find_unused_picture(s, 0);
+if (i < 0)
+return i;
+s->current_picture_ptr = &s->picture[i];
+}
+
 avctx->has_b_frames = !s->low_delay;
 
 #define SET_QPEL_FUNC(postfix1, postfix2)   \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '552bc42df48784ae3ce0d499ece5b33f3cc7576a'

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Aug 15 
02:41:43 2014 +0200| [595c63357cdc4e08a36971f2aae0fb1f019e7224] | committer: 
Michael Niedermayer

Merge commit '552bc42df48784ae3ce0d499ece5b33f3cc7576a'

* commit '552bc42df48784ae3ce0d499ece5b33f3cc7576a':
  h261dec: Fix order of initialization

Merged-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=595c63357cdc4e08a36971f2aae0fb1f019e7224
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] h261dec: Fix order of initialization

2014-08-14 Thread John Stebbins
ffmpeg | branch: master | John Stebbins  | Fri Aug  8 
08:55:48 2014 -0700| [552bc42df48784ae3ce0d499ece5b33f3cc7576a] | committer: 
John Stebbins

h261dec: Fix order of initialization

ff_MPV_common_init requires the frame dimensions which get parsed in
h261_decode_picture_header.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=552bc42df48784ae3ce0d499ece5b33f3cc7576a
---

 libavcodec/h261dec.c |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 88ca63d..6b358a6 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -581,12 +581,9 @@ static int h261_decode_frame(AVCodecContext *avctx, void 
*data,
 retry:
 init_get_bits(&s->gb, buf, buf_size * 8);
 
-if (!s->context_initialized) {
+if (!s->context_initialized)
 // we need the IDCT permutaton for reading a custom matrix
 ff_mpv_idct_init(s);
-if (ff_MPV_common_init(s) < 0)
-return -1;
-}
 
 ret = h261_decode_picture_header(h);
 
@@ -602,6 +599,11 @@ retry:
 ff_MPV_common_end(s);
 s->parse_context = pc;
 }
+
+if (!s->context_initialized)
+if ((ret = ff_MPV_common_init(s)) < 0)
+return ret;
+
 if (!s->context_initialized) {
 ret = ff_set_dimensions(avctx, s->width, s->height);
 if (ret < 0)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h261dec: Fix context initialization sequence

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Aug 15 
02:50:41 2014 +0200| [6c1ee1a11446abbe662fc89b9dff0f0a3d5fdd55] | committer: 
Michael Niedermayer

avcodec/h261dec: Fix context initialization sequence

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6c1ee1a11446abbe662fc89b9dff0f0a3d5fdd55
---

 libavcodec/h261dec.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index dea554b..5bc685e 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -609,11 +609,10 @@ retry:
 s->parse_context = pc;
 }
 
-if (!s->context_initialized)
+if (!s->context_initialized) {
 if ((ret = ff_MPV_common_init(s)) < 0)
 return ret;
 
-if (!s->context_initialized) {
 ret = ff_set_dimensions(avctx, s->width, s->height);
 if (ret < 0)
 return ret;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffmpeg: fix streamcopy with side data

2014-08-14 Thread Christophe Gisquet
ffmpeg | branch: master | Christophe Gisquet  | 
Wed Aug 13 18:40:17 2014 +0200| [33fefdb44992bce18acb4548f28c9cd5b31de11f] | 
committer: Michael Niedermayer

ffmpeg: fix streamcopy with side data

The issue is that, when the main packet data buffer is changed, streamcopy
uses a temporary new packet to store that buffer, frees the old packet, and
replace it with the new packet.

However, in doing so, it forgets about the side data, which gets freed, but
is still needed and referenced. Then, when the packet gets freed again in
the normal code path, it attempts to free its side data which has already
been freed.

Therefore, simply avoid the first free on side data by removing that side
data from the packet.

Fixes ticket #3773.

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33fefdb44992bce18acb4548f28c9cd5b31de11f
---

 ffmpeg.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index b82d2be..60b10cc 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -627,6 +627,8 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, 
OutputStream *ost)
 a = AVERROR(ENOMEM);
 }
 if (a > 0) {
+pkt->side_data = NULL;
+pkt->side_data_elems = 0;
 av_free_packet(pkt);
 new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size,
av_buffer_default_free, NULL, 0);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffmpeg: remove 32 channel limit from audio_channels_map

2014-08-14 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri Aug 15 
04:46:24 2014 +0200| [d3a22491c736588ee1e94a240bbe9e35bbb8d88a] | committer: 
Michael Niedermayer

ffmpeg: remove 32 channel limit from audio_channels_map

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3a22491c736588ee1e94a240bbe9e35bbb8d88a
---

 ffmpeg.c |3 +++
 ffmpeg.h |3 +--
 ffmpeg_opt.c |   12 +++-
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 60b10cc..7999f72 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -483,6 +483,9 @@ static void ffmpeg_cleanup(int ret)
 av_freep(&ost->avfilter);
 av_freep(&ost->logfile_prefix);
 
+av_freep(&ost->audio_channels_map);
+ost->audio_channels_mapped = 0;
+
 avcodec_free_context(&ost->enc_ctx);
 
 av_freep(&output_streams[i]);
diff --git a/ffmpeg.h b/ffmpeg.h
index d124a2c..6545286 100644
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -402,8 +402,7 @@ typedef struct OutputStream {
 double forced_keyframes_expr_const_values[FKF_NB];
 
 /* audio only */
-#define FF_CH_MAX 32
-int audio_channels_map[FF_CH_MAX];   /* list of the channels id to pick 
from the source stream */
+int *audio_channels_map; /* list of the channels id to pick 
from the source stream */
 int audio_channels_mapped;   /* number of channels in 
audio_channels_map */
 
 char *logfile_prefix;
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 1962cf4..3cf78f0 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1478,11 +1478,13 @@ static OutputStream *new_audio_stream(OptionsContext 
*o, AVFormatContext *oc, in
 }
 
 if (!ist || (ist->file_index == map->file_idx && 
ist->st->index == map->stream_idx)) {
-if (ost->audio_channels_mapped < 
FF_ARRAY_ELEMS(ost->audio_channels_map))
-ost->audio_channels_map[ost->audio_channels_mapped++] 
= map->channel_idx;
-else
-av_log(NULL, AV_LOG_FATAL, "Max channel mapping for 
output %d.%d reached\n",
-   ost->file_index, ost->st->index);
+if (av_reallocp_array(&ost->audio_channels_map,
+  ost->audio_channels_mapped + 1,
+  sizeof(*ost->audio_channels_map)
+  ) < 0 )
+exit_program(1);
+
+ost->audio_channels_map[ost->audio_channels_mapped++] = 
map->channel_idx;
 }
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog