[FFmpeg-cvslog] lavfi/deshake: fix deshake crash issue.
ffmpeg | branch: master | Jun Zhao | Tue Sep 18 14:57:49 2018 +0800| [5a3ce4a92b84cded3aab7ffd7fb80e0c9130e74c] | committer: Jun Zhao lavfi/deshake: fix deshake crash issue. Fixes ticket #7441. for block contrast calculate, the block is like this: |< stride---| +---> X | |w = 16 |(cx,cy)+--+ | | | |h=blocksize| | | | | | +--+ V Y so we calc the block contrast use: (cy + y) * stride + (cx + x) Signed-off-by: Jun Zhao > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a3ce4a92b84cded3aab7ffd7fb80e0c9130e74c --- libavfilter/vf_deshake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c index 55ce5e18a1..c8480e74dd 100644 --- a/libavfilter/vf_deshake.c +++ b/libavfilter/vf_deshake.c @@ -196,7 +196,7 @@ static int block_contrast(uint8_t *src, int x, int y, int stride, int blocksize) for (i = 0; i <= blocksize * 2; i++) { // We use a width of 16 here to match the sad function for (j = 0; j <= 15; j++) { -pos = (y - i) * stride + (x - j); +pos = (y + i) * stride + (x + j); if (src[pos] < lowest) lowest = src[pos]; else if (src[pos] > highest) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavu/qsv: fix a random hwupload failure regression
ffmpeg | branch: master | Zhong Li | Sun Sep 30 17:59:52 2018 +0800| [21733b39d0af5211d7b9f168ff3667ea86362e2b] | committer: Luca Barbato lavu/qsv: fix a random hwupload failure regression Variable 'ret' hasn't been initialized,thus introducing a random hwupload failure regression due to qsv session uninitialized. Signed-off-by: Zhong Li Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21733b39d0af5211d7b9f168ff3667ea86362e2b --- libavutil/hwcontext_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 1887936e33..f550bac572 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -833,7 +833,7 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, mfxSyncPoint sync = NULL; mfxStatus err; -int ret; +int ret = 0; while (!s->session_upload_init && !s->session_upload && !ret) { #if HAVE_PTHREADS ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '21733b39d0af5211d7b9f168ff3667ea86362e2b'
ffmpeg | branch: master | Mark Thompson | Sat Oct 6 18:43:28 2018 +0100| [1f1ec958f6c68a5ceafea206a99c895f62d0f3ec] | committer: Mark Thompson Merge commit '21733b39d0af5211d7b9f168ff3667ea86362e2b' * commit '21733b39d0af5211d7b9f168ff3667ea86362e2b': lavu/qsv: fix a random hwupload failure regression Fixes CID #1439585. Merged-by: Mark Thompson > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f1ec958f6c68a5ceafea206a99c895f62d0f3ec --- libavutil/hwcontext_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 9d64c7344f..a581d2a401 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -833,7 +833,7 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, mfxSyncPoint sync = NULL; mfxStatus err; -int ret; +int ret = 0; while (!s->session_upload_init && !s->session_upload && !ret) { #if HAVE_PTHREADS == ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/avf_showspectrum: switch to activate and add fps option
ffmpeg | branch: master | Paul B Mahol | Sat Oct 6 12:32:55 2018 +0200| [c98ffa086c5d3c30256744ce568a3b76cd5a72b0] | committer: Paul B Mahol avfilter/avf_showspectrum: switch to activate and add fps option > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c98ffa086c5d3c30256744ce568a3b76cd5a72b0 --- doc/filters.texi | 3 + libavfilter/avf_showspectrum.c | 162 + 2 files changed, 101 insertions(+), 64 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 30a52c4fdb..c0ec41df8a 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -20727,6 +20727,9 @@ Set start frequency from which to display spectrogram. Default is @code{0}. @item stop Set stop frequency to which to display spectrogram. Default is @code{0}. + +@item fps +Set upper frame rate limit. Default is @code{auto}, unlimited. @end table The usage is very similar to the showwaves filter; see the examples in that diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c index f5e8561713..883413b468 100644 --- a/libavfilter/avf_showspectrum.c +++ b/libavfilter/avf_showspectrum.c @@ -34,10 +34,12 @@ #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/opt.h" +#include "libavutil/parseutils.h" #include "libavutil/xga_font_data.h" #include "audio.h" #include "video.h" #include "avfilter.h" +#include "filters.h" #include "internal.h" #include "window_func.h" @@ -51,6 +53,9 @@ enum Orientation { VERTICAL, HORIZONTAL, NB_ORIENTATIONS }; typedef struct ShowSpectrumContext { const AVClass *class; int w, h; +char *rate_str; +AVRational auto_frame_rate; +AVRational frame_rate; AVFrame *outpicref; int nb_display_channels; int orientation; @@ -79,11 +84,13 @@ typedef struct ShowSpectrumContext { double win_scale; float overlap; float gain; +int consumed; int hop_size; float *combine_buffer; ///< color combining buffer (3 * h items) float **color_buffer; ///< color buffer (3 * h * ch items) AVAudioFifo *fifo; int64_t pts; +int64_t old_pts; int single_pic; int legend; int start_x, start_y; @@ -155,6 +162,7 @@ static const AVOption showspectrum_options[] = { { "rotation", "color rotation", OFFSET(rotation), AV_OPT_TYPE_FLOAT, {.dbl = 0}, -1, 1, FLAGS }, { "start", "start frequency", OFFSET(start), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT32_MAX, FLAGS }, { "stop", "stop frequency", OFFSET(stop), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT32_MAX, FLAGS }, +{ "fps", "set video rate", OFFSET(rate_str), AV_OPT_TYPE_STRING, {.str = "auto"}, 0, 0, FLAGS }, { NULL } }; @@ -436,8 +444,6 @@ static int config_output(AVFilterLink *outlink) return AVERROR(EINVAL); } -s->pts = AV_NOPTS_VALUE; - if (!strcmp(ctx->filter->name, "showspectrumpic")) s->single_pic = 1; @@ -602,11 +608,20 @@ static int config_output(AVFilterLink *outlink) (s->orientation == HORIZONTAL && s->xpos >= s->h)) s->xpos = 0; -outlink->frame_rate = av_make_q(inlink->sample_rate, s->win_size * (1.-s->overlap)); +s->auto_frame_rate = av_make_q(inlink->sample_rate, s->hop_size); if (s->orientation == VERTICAL && s->sliding == FULLFRAME) -outlink->frame_rate.den *= s->w; +s->auto_frame_rate.den *= s->w; if (s->orientation == HORIZONTAL && s->sliding == FULLFRAME) -outlink->frame_rate.den *= s->h; +s->auto_frame_rate.den *= s->h; +if (!s->single_pic && strcmp(s->rate_str, "auto")) { +int ret = av_parse_video_rate(&s->frame_rate, s->rate_str); +if (ret < 0) +return ret; +} else { +s->frame_rate = s->auto_frame_rate; +} +outlink->frame_rate = s->frame_rate; +outlink->time_base = av_inv_q(outlink->frame_rate); if (s->orientation == VERTICAL) { s->combine_buffer = @@ -945,7 +960,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples) } if (s->sliding != FULLFRAME || s->xpos == 0) -outpicref->pts = insamples->pts; +outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base); s->xpos++; if (s->orientation == VERTICAL && s->xpos >= s->w) @@ -953,70 +968,57 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples) if (s->orientation == HORIZONTAL && s->xpos >= s->h) s->xpos = 0; if (!s->single_pic && (s->sliding != FULLFRAME || s->xpos == 0)) { -ret = ff_filter_frame(outlink, av_frame_clone(s->outpicref)); -if (ret < 0) -return ret; +if (s->old_pts < outpicref->pts) { +s->old_pts = outpicref->pts; +ret = ff_filter_frame(outlink, av_frame_clone(s->outpicref)); +if (ret < 0) +return ret; +return 0; +} } -return
[FFmpeg-cvslog] avfilter/af_aiir: Remove l from %lf in av_log environment
ffmpeg | branch: master | Michael Niedermayer | Wed Sep 19 18:05:26 2018 +0200| [8dd7c2c6a71b078ca4f1f9232b05f4a9bdd418aa] | committer: Michael Niedermayer avfilter/af_aiir: Remove l from %lf in av_log environment The l modifier does nothing in C99 and it was undefined in C89 for %f Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8dd7c2c6a71b078ca4f1f9232b05f4a9bdd418aa --- libavfilter/af_aiir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c index 9a4769c25f..845d542d29 100644 --- a/libavfilter/af_aiir.c +++ b/libavfilter/af_aiir.c @@ -413,7 +413,7 @@ static int expand(AVFilterContext *ctx, double *pz, int nb, double *coeffs) for (i = 0; i < nb + 1; i++) { if (fabs(coeffs[2 * i + 1]) > FLT_EPSILON) { -av_log(ctx, AV_LOG_ERROR, "coeff: %lf of z^%d is not real; poles/zeros are not complex conjugates.\n", +av_log(ctx, AV_LOG_ERROR, "coeff: %f of z^%d is not real; poles/zeros are not complex conjugates.\n", coeffs[2 * i + 1], i); return AVERROR(EINVAL); } @@ -592,7 +592,7 @@ static int decompose_zp2biquads(AVFilterContext *ctx, int channels) iir->biquads[current_biquad].b1 = b[2] / a[4] * (current_biquad ? 1.0 : iir->g); iir->biquads[current_biquad].b2 = b[0] / a[4] * (current_biquad ? 1.0 : iir->g); -av_log(ctx, AV_LOG_VERBOSE, "a=%lf %lf %lf:b=%lf %lf %lf\n", +av_log(ctx, AV_LOG_VERBOSE, "a=%f %f %f:b=%f %f %f\n", iir->biquads[current_biquad].a0, iir->biquads[current_biquad].a1, iir->biquads[current_biquad].a2, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libavcodec/v4l2_buffers.h: fix cant typos
ffmpeg | branch: master | Michael Niedermayer | Wed Sep 19 18:05:28 2018 +0200| [1a7a17fb75e89b0e58d2babdfdd8ea4f3c4770f6] | committer: Michael Niedermayer libavcodec/v4l2_buffers.h: fix cant typos Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a7a17fb75e89b0e58d2babdfdd8ea4f3c4770f6 --- libavcodec/v4l2_buffers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_buffers.h b/libavcodec/v4l2_buffers.h index dc5cc9e267..7a57caf949 100644 --- a/libavcodec/v4l2_buffers.h +++ b/libavcodec/v4l2_buffers.h @@ -72,7 +72,7 @@ typedef struct V4L2Buffer { * @param[in] buf The V4L2Buffer to get the information from * * @returns 0 in case of success, AVERROR(EINVAL) if the number of planes is incorrect, - * AVERROR(ENOMEM) if the AVBufferRef cant be created. + * AVERROR(ENOMEM) if the AVBufferRef can't be created. */ int ff_v4l2_buffer_buf_to_avframe(AVFrame *frame, V4L2Buffer *buf); @@ -83,7 +83,7 @@ int ff_v4l2_buffer_buf_to_avframe(AVFrame *frame, V4L2Buffer *buf); * @param[in] buf The V4L2Buffer to get the information from * * @returns 0 in case of success, AVERROR(EINVAL) if the number of planes is incorrect, - * AVERROR(ENOMEM) if the AVBufferRef cant be created. + * AVERROR(ENOMEM) if the AVBufferRef can't be created. * */ int ff_v4l2_buffer_buf_to_avpkt(AVPacket *pkt, V4L2Buffer *buf); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/speedhq: Make speedhq_vlc const
ffmpeg | branch: master | Michael Niedermayer | Wed Sep 19 18:05:32 2018 +0200| [fd3eda40308ebc4eae02d2a0877edb8aeb206a5f] | committer: Michael Niedermayer avcodec/speedhq: Make speedhq_vlc const Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fd3eda40308ebc4eae02d2a0877edb8aeb206a5f --- libavcodec/speedhq.c | 73 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 6d3487ca19..890b8253cd 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -58,40 +58,40 @@ typedef struct SHQContext { /* AC codes: Very similar but not identical to MPEG-2. */ -static uint16_t speedhq_vlc[123][2] = { -{0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5}, -{0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7}, -{0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8}, -{0xfb, 8}, {0xfe, 8}, {0xff, 8}, {0x1f,14}, -{0x1e,14}, {0x1d,14}, {0x1c,14}, {0x1b,14}, -{0x1a,14}, {0x19,14}, {0x18,14}, {0x17,14}, -{0x16,14}, {0x15,14}, {0x14,14}, {0x13,14}, -{0x12,14}, {0x11,14}, {0x10,14}, {0x18,15}, -{0x17,15}, {0x16,15}, {0x15,15}, {0x14,15}, -{0x13,15}, {0x12,15}, {0x11,15}, {0x10,15}, -{0x02, 3}, {0x06, 5}, {0x79, 7}, {0x27, 8}, -{0x20, 8}, {0x16,13}, {0x15,13}, {0x1f,15}, -{0x1e,15}, {0x1d,15}, {0x1c,15}, {0x1b,15}, -{0x1a,15}, {0x19,15}, {0x13,16}, {0x12,16}, -{0x11,16}, {0x10,16}, {0x18,13}, {0x17,13}, -{0x05, 5}, {0x07, 7}, {0xfc, 8}, {0x0c,10}, -{0x14,13}, {0x18,12}, {0x14,12}, {0x13,12}, -{0x10,12}, {0x1a,13}, {0x19,13}, {0x07, 5}, -{0x26, 8}, {0x1c,12}, {0x13,13}, {0x1b,12}, -{0x06, 6}, {0xfd, 8}, {0x12,12}, {0x1d,12}, -{0x07, 6}, {0x04, 9}, {0x12,13}, {0x06, 7}, -{0x1e,12}, {0x14,16}, {0x04, 7}, {0x15,12}, -{0x05, 7}, {0x11,12}, {0x78, 7}, {0x11,13}, -{0x7a, 7}, {0x10,13}, {0x21, 8}, {0x1a,16}, -{0x25, 8}, {0x19,16}, {0x24, 8}, {0x18,16}, -{0x05, 9}, {0x17,16}, {0x07, 9}, {0x16,16}, -{0x0d,10}, {0x15,16}, {0x1f,12}, {0x1a,12}, -{0x19,12}, {0x17,12}, {0x16,12}, {0x1f,13}, -{0x1e,13}, {0x1d,13}, {0x1c,13}, {0x1b,13}, -{0x1f,16}, {0x1e,16}, {0x1d,16}, {0x1c,16}, -{0x1b,16}, -{0x01,6}, /* escape */ -{0x06,4}, /* EOB */ +static const uint16_t speedhq_vlc[123][2] = { +{0x0001, 2}, {0x0003, 3}, {0x000E, 4}, {0x0007, 5}, +{0x0017, 5}, {0x0028, 6}, {0x0008, 6}, {0x006F, 7}, +{0x001F, 7}, {0x00C4, 8}, {0x0044, 8}, {0x005F, 8}, +{0x00DF, 8}, {0x007F, 8}, {0x00FF, 8}, {0x3E00, 14}, +{0x1E00, 14}, {0x2E00, 14}, {0x0E00, 14}, {0x3600, 14}, +{0x1600, 14}, {0x2600, 14}, {0x0600, 14}, {0x3A00, 14}, +{0x1A00, 14}, {0x2A00, 14}, {0x0A00, 14}, {0x3200, 14}, +{0x1200, 14}, {0x2200, 14}, {0x0200, 14}, {0x0C00, 15}, +{0x7400, 15}, {0x3400, 15}, {0x5400, 15}, {0x1400, 15}, +{0x6400, 15}, {0x2400, 15}, {0x4400, 15}, {0x0400, 15}, +{0x0002, 3}, {0x000C, 5}, {0x004F, 7}, {0x00E4, 8}, +{0x0004, 8}, {0x0D00, 13}, {0x1500, 13}, {0x7C00, 15}, +{0x3C00, 15}, {0x5C00, 15}, {0x1C00, 15}, {0x6C00, 15}, +{0x2C00, 15}, {0x4C00, 15}, {0xC800, 16}, {0x4800, 16}, +{0x8800, 16}, {0x0800, 16}, {0x0300, 13}, {0x1D00, 13}, +{0x0014, 5}, {0x0070, 7}, {0x003F, 8}, {0x00C0, 10}, +{0x0500, 13}, {0x0180, 12}, {0x0280, 12}, {0x0C80, 12}, +{0x0080, 12}, {0x0B00, 13}, {0x1300, 13}, {0x001C, 5}, +{0x0064, 8}, {0x0380, 12}, {0x1900, 13}, {0x0D80, 12}, +{0x0018, 6}, {0x00BF, 8}, {0x0480, 12}, {0x0B80, 12}, +{0x0038, 6}, {0x0040, 9}, {0x0900, 13}, {0x0030, 7}, +{0x0780, 12}, {0x2800, 16}, {0x0010, 7}, {0x0A80, 12}, +{0x0050, 7}, {0x0880, 12}, {0x000F, 7}, {0x1100, 13}, +{0x002F, 7}, {0x0100, 13}, {0x0084, 8}, {0x5800, 16}, +{0x00A4, 8}, {0x9800, 16}, {0x0024, 8}, {0x1800, 16}, +{0x0140, 9}, {0xE800, 16}, {0x01C0, 9}, {0x6800, 16}, +{0x02C0, 10}, {0xA800, 16}, {0x0F80, 12}, {0x0580, 12}, +{0x0980, 12}, {0x0E80, 12}, {0x0680, 12}, {0x1F00, 13}, +{0x0F00, 13}, {0x1700, 13}, {0x0700, 13}, {0x1B00, 13}, +{0xF800, 16}, {0x7800, 16}, {0xB800, 16}, {0x3800, 16}, +{0xD800, 16}, +{0x0020, 6}, /* escape */ +{0x0006, 4} /* EOB */ }; static const uint8_t speedhq_level[121] = { @@ -580,7 +580,6 @@ static av_cold void speedhq_static_init(void) { uint16_t ff_mpeg12_vlc_dc_lum_code_reversed[12]; uint16_t ff_mpeg12_vlc_dc_chroma_code_reversed[12]; -int i; /* Exactly the same as MPEG-2, except little-endian. */ reverse_code(ff_mpeg12_vlc_dc_lum_code, @@ -598,10 +597,6 @@ static av_cold void speedhq_static_init(void) ff_mpeg12_vlc_dc_chroma_bits, 1, 1, ff_mpeg12_vlc_dc_chroma_code_reversed, 2, 2, 514); -/* Reverse the AC VLC, because INIT_VLC_LE wants it in that order. */ -for (i = 0; i < FF_ARRAY_ELEMS(speedhq_vlc); ++i) { -speedhq_vlc[i][0] = reverse(spee
[FFmpeg-cvslog] avfilter/af_biquads: Remove l from %lf in av_log environment
ffmpeg | branch: master | Michael Niedermayer | Wed Sep 19 18:05:27 2018 +0200| [64144158890baece498a9b9ebdb67f2466f28fdb] | committer: Michael Niedermayer avfilter/af_biquads: Remove l from %lf in av_log environment The l modifier does nothing in C99 and it was undefined in C89 for %f Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=64144158890baece498a9b9ebdb67f2466f28fdb --- libavfilter/af_biquads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c index 56d3035d77..ae5e1c6ade 100644 --- a/libavfilter/af_biquads.c +++ b/libavfilter/af_biquads.c @@ -383,7 +383,7 @@ static int config_filter(AVFilterLink *outlink, int reset) av_assert0(0); } -av_log(ctx, AV_LOG_VERBOSE, "a=%lf %lf %lf:b=%lf %lf %lf\n", s->a0, s->a1, s->a2, s->b0, s->b1, s->b2); +av_log(ctx, AV_LOG_VERBOSE, "a=%f %f %f:b=%f %f %f\n", s->a0, s->a1, s->a2, s->b0, s->b1, s->b2); s->a1 /= s->a0; s->a2 /= s->a0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: Do not use "i" as a context pointer, "i" is normally the integer counter in loops
ffmpeg | branch: master | Michael Niedermayer | Thu Sep 27 00:00:25 2018 +0200| [b4a1ccfc41613ae476791e539c176ac98be03a05] | committer: Michael Niedermayer avformat/utils: Do not use "i" as a context pointer, "i" is normally the integer counter in loops This avoids surprising developers. Its bad to surprise developers with such unexpected things. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4a1ccfc41613ae476791e539c176ac98be03a05 --- libavformat/utils.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 7e5783c14c..dcc0de9255 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3461,7 +3461,7 @@ static int extract_extradata_check(AVStream *st) static int extract_extradata_init(AVStream *st) { -AVStreamInternal *i = st->internal; +AVStreamInternal *sti = st->internal; const AVBitStreamFilter *f; int ret; @@ -3474,66 +3474,66 @@ static int extract_extradata_init(AVStream *st) if (!ret) goto finish; -i->extract_extradata.pkt = av_packet_alloc(); -if (!i->extract_extradata.pkt) +sti->extract_extradata.pkt = av_packet_alloc(); +if (!sti->extract_extradata.pkt) return AVERROR(ENOMEM); -ret = av_bsf_alloc(f, &i->extract_extradata.bsf); +ret = av_bsf_alloc(f, &sti->extract_extradata.bsf); if (ret < 0) goto fail; -ret = avcodec_parameters_copy(i->extract_extradata.bsf->par_in, +ret = avcodec_parameters_copy(sti->extract_extradata.bsf->par_in, st->codecpar); if (ret < 0) goto fail; -i->extract_extradata.bsf->time_base_in = st->time_base; +sti->extract_extradata.bsf->time_base_in = st->time_base; -ret = av_bsf_init(i->extract_extradata.bsf); +ret = av_bsf_init(sti->extract_extradata.bsf); if (ret < 0) goto fail; finish: -i->extract_extradata.inited = 1; +sti->extract_extradata.inited = 1; return 0; fail: -av_bsf_free(&i->extract_extradata.bsf); -av_packet_free(&i->extract_extradata.pkt); +av_bsf_free(&sti->extract_extradata.bsf); +av_packet_free(&sti->extract_extradata.pkt); return ret; } static int extract_extradata(AVStream *st, AVPacket *pkt) { -AVStreamInternal *i = st->internal; +AVStreamInternal *sti = st->internal; AVPacket *pkt_ref; int ret; -if (!i->extract_extradata.inited) { +if (!sti->extract_extradata.inited) { ret = extract_extradata_init(st); if (ret < 0) return ret; } -if (i->extract_extradata.inited && !i->extract_extradata.bsf) +if (sti->extract_extradata.inited && !sti->extract_extradata.bsf) return 0; -pkt_ref = i->extract_extradata.pkt; +pkt_ref = sti->extract_extradata.pkt; ret = av_packet_ref(pkt_ref, pkt); if (ret < 0) return ret; -ret = av_bsf_send_packet(i->extract_extradata.bsf, pkt_ref); +ret = av_bsf_send_packet(sti->extract_extradata.bsf, pkt_ref); if (ret < 0) { av_packet_unref(pkt_ref); return ret; } -while (ret >= 0 && !i->avctx->extradata) { +while (ret >= 0 && !sti->avctx->extradata) { int extradata_size; uint8_t *extradata; -ret = av_bsf_receive_packet(i->extract_extradata.bsf, pkt_ref); +ret = av_bsf_receive_packet(sti->extract_extradata.bsf, pkt_ref); if (ret < 0) { if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) return ret; @@ -3544,13 +3544,13 @@ static int extract_extradata(AVStream *st, AVPacket *pkt) &extradata_size); if (extradata) { -i->avctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); -if (!i->avctx->extradata) { +sti->avctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); +if (!sti->avctx->extradata) { av_packet_unref(pkt_ref); return AVERROR(ENOMEM); } -memcpy(i->avctx->extradata, extradata, extradata_size); -i->avctx->extradata_size = extradata_size; +memcpy(sti->avctx->extradata, extradata, extradata_size); +sti->avctx->extradata_size = extradata_size; } av_packet_unref(pkt_ref); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: Fix potential integer overflow in extract_extradata()
ffmpeg | branch: master | Michael Niedermayer | Thu Sep 27 00:00:26 2018 +0200| [0a41a8bf2945e59db7a0773ebce11a26b95d45b6] | committer: Michael Niedermayer avformat/utils: Fix potential integer overflow in extract_extradata() Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0a41a8bf2945e59db7a0773ebce11a26b95d45b6 --- libavformat/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index dcc0de9255..a8ac90213e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3544,7 +3544,9 @@ static int extract_extradata(AVStream *st, AVPacket *pkt) &extradata_size); if (extradata) { -sti->avctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); +av_assert0(!sti->avctx->extradata); +if ((unsigned)extradata_size < FF_MAX_EXTRADATA_SIZE) +sti->avctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!sti->avctx->extradata) { av_packet_unref(pkt_ref); return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libavformat/ty: use decimal constant for shift
ffmpeg | branch: master | Michael Niedermayer | Wed Sep 19 18:05:23 2018 +0200| [8c49340b189fe6e2f563a00c708eec97101ae337] | committer: Michael Niedermayer libavformat/ty: use decimal constant for shift This was the only case in the source that uses a hexadecimal shift value. The change removed a special case in respect to greping Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c49340b189fe6e2f563a00c708eec97101ae337 --- libavformat/ty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/ty.c b/libavformat/ty.c index d348643f40..8230d3a2bb 100644 --- a/libavformat/ty.c +++ b/libavformat/ty.c @@ -254,7 +254,7 @@ static int analyze_chunk(AVFormatContext *s, const uint8_t *chunk) if (data_offset + hdrs[i].rec_size > CHUNK_SIZE) break; -if ((hdrs[i].subrec_type << 0x08 | hdrs[i].rec_type) == 0x3c0 && hdrs[i].rec_size > 15) { +if ((hdrs[i].subrec_type << 8 | hdrs[i].rec_type) == 0x3c0 && hdrs[i].rec_size > 15) { /* first make sure we're aligned */ int pes_offset = find_es_header(ty_MPEGAudioPacket, &chunk[data_offset], 5); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/unary: Improve get_unary() docs
ffmpeg | branch: master | Michael Niedermayer | Sat Sep 22 15:18:17 2018 +0200| [ad89e203bfedf25df00e2a6ed9196170d772f25b] | committer: Michael Niedermayer avcodec/unary: Improve get_unary() docs Found-by: kierank Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad89e203bfedf25df00e2a6ed9196170d772f25b --- libavcodec/unary.h | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libavcodec/unary.h b/libavcodec/unary.h index 908dc93507..d57f9f70c5 100644 --- a/libavcodec/unary.h +++ b/libavcodec/unary.h @@ -28,7 +28,20 @@ * @param gb GetBitContext * @param[in] stop The bitstop value (unary code of 1's or 0's) * @param[in] len Maximum length - * @return Unary length/index + * @return unary 0 based code index. This is also the length in bits of the + * code excluding the stop bit. + * (in case len=1) + * 10 + * 01 + * (in case len=2) + * 10 + * 01 1 + * 00 2 + * (in case len=3) + * 10 + * 01 1 + * 001 2 + * 000 3 */ static inline int get_unary(GetBitContext *gb, int stop, int len) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/movenc: Remove unneeded variable from mov_find_codec_tag()
ffmpeg | branch: master | Michael Niedermayer | Wed Sep 19 18:05:25 2018 +0200| [52e62b0585c19942bee85786e7398b54d91fd520] | committer: Michael Niedermayer avformat/movenc: Remove unneeded variable from mov_find_codec_tag() Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52e62b0585c19942bee85786e7398b54d91fd520 --- libavformat/movenc.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 6b9c012bc6..33978ee1b0 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1611,8 +1611,6 @@ static unsigned int validate_codec_tag(const AVCodecTag *const *tags, static unsigned int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track) { -unsigned int tag; - if (is_cover_image(track->st)) return ff_codec_get_tag(codec_cover_image_tags, track->par->codec_id); @@ -1623,12 +1621,11 @@ static unsigned int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track) av_log(s, AV_LOG_WARNING, "Warning, extension is not .m4a nor .m4v " "Quicktime/Ipod might not play the file\n"); -if (track->mode == MODE_MOV) -tag = mov_get_codec_tag(s, track); -else -tag = validate_codec_tag(s->oformat->codec_tag, track->par->codec_tag, - track->par->codec_id); -return tag; +if (track->mode == MODE_MOV) { +return mov_get_codec_tag(s, track); +} else +return validate_codec_tag(s->oformat->codec_tag, track->par->codec_tag, + track->par->codec_id); } /** Write uuid atom. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_tonemap_opencl: Fix seperate typo
ffmpeg | branch: master | Michael Niedermayer | Wed Sep 19 18:05:30 2018 +0200| [c07bbdbcf051c8ae134ee0505e3687e4208a6674] | committer: Michael Niedermayer avfilter/vf_tonemap_opencl: Fix seperate typo Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c07bbdbcf051c8ae134ee0505e3687e4208a6674 --- libavfilter/vf_tonemap_opencl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_tonemap_opencl.c b/libavfilter/vf_tonemap_opencl.c index 5da2333169..cd293c2522 100644 --- a/libavfilter/vf_tonemap_opencl.c +++ b/libavfilter/vf_tonemap_opencl.c @@ -33,7 +33,7 @@ #include "colorspace.h" // TODO: -// - seperate peak-detection from tone-mapping kernel to solve +// - separate peak-detection from tone-mapping kernel to solve //one-frame-delay issue. // - import colorspace matrix generation from vf_colorspace.c // - more format support ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vc1_loopfilter: Fix colums typos
ffmpeg | branch: master | Michael Niedermayer | Wed Sep 19 18:05:29 2018 +0200| [1fc3d8ee004a2a5143fc2fe533b2aaca4b4f0c3f] | committer: Michael Niedermayer avcodec/vc1_loopfilter: Fix colums typos Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1fc3d8ee004a2a5143fc2fe533b2aaca4b4f0c3f --- libavcodec/vc1_loopfilter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/vc1_loopfilter.c b/libavcodec/vc1_loopfilter.c index d43fa5b3ae..0f990cccef 100644 --- a/libavcodec/vc1_loopfilter.c +++ b/libavcodec/vc1_loopfilter.c @@ -284,7 +284,7 @@ void ff_vc1_i_loop_filter(VC1Context *v) * bottom edge of this MB, before moving over and running the H loop * filter on the left and internal vertical borders. Therefore, the loop * filter trails by one row and one column relative to the overlap filter - * and two rows and two colums relative to the decoding loop. */ + * and two rows and two columns relative to the decoding loop. */ if (!s->first_slice_line) { dest = s->dest[0] - 16 * s->linesize - 16; flags = s->mb_y == s->start_mb_y + 1 ? TOP_EDGE : 0; @@ -485,7 +485,7 @@ void ff_vc1_p_loop_filter(VC1Context *v) * we wait for the next loop filter iteration to do H loop filter on all * applicable vertical borders of this MB. Therefore, the loop filter * trails by one row and one column relative to the overlap filter and two - * rows and two colums relative to the decoding loop. */ + * rows and two columns relative to the decoding loop. */ if (s->mb_y >= s->start_mb_y + 2) { if (s->mb_x) { dest = s->dest[0] - 32 * s->linesize - 16; @@ -923,7 +923,7 @@ void ff_vc1_p_intfr_loop_filter(VC1Context *v) * we wait for the loop filter iteration on the next row and next column to * do H loop filter on all applicable vertical borders of this MB. * Therefore, the loop filter trails by two rows and one column relative to - * the overlap filter and two rows and two colums relative to the decoding + * the overlap filter and two rows and two columns relative to the decoding * loop. */ if (s->mb_x) { if (s->mb_y >= s->start_mb_y + 1) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: Do not ignore failure in extract_extradata_init()
ffmpeg | branch: master | Michael Niedermayer | Thu Sep 27 00:00:24 2018 +0200| [beb3aea48e5f8a3d57f244fb8998ddf04928ee81] | committer: Michael Niedermayer avformat/utils: Do not ignore failure in extract_extradata_init() We check for the documented explanation of the "Ignore code" in extract_extradata_check() already Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=beb3aea48e5f8a3d57f244fb8998ddf04928ee81 --- libavformat/utils.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index c973a7e0c5..7e5783c14c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3489,13 +3489,9 @@ static int extract_extradata_init(AVStream *st) i->extract_extradata.bsf->time_base_in = st->time_base; -/* if init fails here, we assume extracting extradata is just not - * supported for this codec, so we return success */ ret = av_bsf_init(i->extract_extradata.bsf); -if (ret < 0) { -av_bsf_free(&i->extract_extradata.bsf); -ret = 0; -} +if (ret < 0) +goto fail; finish: i->extract_extradata.inited = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog