~ubuntu-branches/debian/sid/ffmpeg/sid

« back to all changes in this revision

Viewing changes to libavfilter/buffersink.c

  • Committer: Package Import Robot
  • Author(s): Andreas Cadhalpun, Fabian Greffrath, Andreas Cadhalpun
  • Date: 2015-09-22 15:15:20 UTC
  • mfrom: (0.1.29)
  • Revision ID: package-import@ubuntu.com-20150922151520-hhmd3in9ykigjvs9
Tags: 7:2.8-1
[ Fabian Greffrath ]
* Pass the --dbg-package=ffmpeg-dbg parameter only to dh_strip.
* Add alternative Depends: libavcodec-ffmpeg-extra56 to libavcodec-dev and
  ffmpeg-dbg to allow for building and debugging with this library installed.

[ Andreas Cadhalpun ]
* Import new major upstream release 2.8.
* Remove the transitional lib*-ffmpeg-dev packages.
* Drop old Breaks on kodi-bin.
* Drop workaround for sparc, which is no Debian architecture anymore.
* Re-enable x265 on alpha, as it's available again.
* Disable unavailable frei0r, opencv and x264 on mips64el.
* Disable libopenjpeg (#787275) and libschroedinger (#787957) decoders.
  (Closes: #786670)
* Disable libdc1394 on sparc64, because it links against the broken due to
  #790560 libudev1.
* Enable libsnappy support.
* Add new symbols.
* Update debian/copyright.
* Update debian/tests/encdec_list.txt.
* Add hls-only-seek-if-there-is-an-offset.patch. (Closes: #798189)
* Add 'Breaks: libavutil-ffmpeg54 (>= 8:0)' to the libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
} BufferSinkContext;
63
63
 
64
64
#define NB_ITEMS(list) (list ## _size / sizeof(*list))
 
65
#define FIFO_INIT_SIZE 8
 
66
#define FIFO_INIT_ELEMENT_SIZE sizeof(void *)
65
67
 
66
68
static av_cold void uninit(AVFilterContext *ctx)
67
69
{
72
74
        av_audio_fifo_free(sink->audio_fifo);
73
75
 
74
76
    if (sink->fifo) {
75
 
        while (av_fifo_size(sink->fifo) >= sizeof(AVFilterBufferRef *)) {
 
77
        while (av_fifo_size(sink->fifo) >= FIFO_INIT_ELEMENT_SIZE) {
76
78
            av_fifo_generic_read(sink->fifo, &frame, sizeof(frame), NULL);
77
79
            av_frame_free(&frame);
78
80
        }
84
86
{
85
87
    BufferSinkContext *buf = ctx->priv;
86
88
 
87
 
    if (av_fifo_space(buf->fifo) < sizeof(AVFilterBufferRef *)) {
 
89
    if (av_fifo_space(buf->fifo) < FIFO_INIT_ELEMENT_SIZE) {
88
90
        /* realloc fifo size */
89
91
        if (av_fifo_realloc2(buf->fifo, av_fifo_size(buf->fifo) * 2) < 0) {
90
92
            av_log(ctx, AV_LOG_ERROR,
95
97
    }
96
98
 
97
99
    /* cache frame */
98
 
    av_fifo_generic_write(buf->fifo, &ref, sizeof(AVFilterBufferRef *), NULL);
 
100
    av_fifo_generic_write(buf->fifo, &ref, FIFO_INIT_ELEMENT_SIZE, NULL);
99
101
    return 0;
100
102
}
101
103
 
108
110
    if ((ret = add_buffer_ref(ctx, frame)) < 0)
109
111
        return ret;
110
112
    if (buf->warning_limit &&
111
 
        av_fifo_size(buf->fifo) / sizeof(AVFilterBufferRef *) >= buf->warning_limit) {
 
113
        av_fifo_size(buf->fifo) / FIFO_INIT_ELEMENT_SIZE >= buf->warning_limit) {
112
114
        av_log(ctx, AV_LOG_WARNING,
113
115
               "%d buffers queued in %s, something may be wrong.\n",
114
116
               buf->warning_limit,
242
244
    return params;
243
245
}
244
246
 
245
 
#define FIFO_INIT_SIZE 8
246
 
 
247
247
static av_cold int common_init(AVFilterContext *ctx)
248
248
{
249
249
    BufferSinkContext *buf = ctx->priv;
250
250
 
251
 
    buf->fifo = av_fifo_alloc_array(FIFO_INIT_SIZE, sizeof(AVFilterBufferRef *));
 
251
    buf->fifo = av_fifo_alloc_array(FIFO_INIT_SIZE, FIFO_INIT_ELEMENT_SIZE);
252
252
    if (!buf->fifo) {
253
253
        av_log(ctx, AV_LOG_ERROR, "Failed to allocate fifo\n");
254
254
        return AVERROR(ENOMEM);
363
363
    return ctx->inputs[0]->frame_rate;
364
364
}
365
365
 
 
366
#if FF_API_AVFILTERBUFFER
 
367
FF_DISABLE_DEPRECATION_WARNINGS
366
368
int attribute_align_arg av_buffersink_poll_frame(AVFilterContext *ctx)
367
369
{
368
370
    BufferSinkContext *buf = ctx->priv;
373
375
               || !strcmp(ctx->filter->name, "ffbuffersink")
374
376
               || !strcmp(ctx->filter->name, "ffabuffersink"));
375
377
 
376
 
    return av_fifo_size(buf->fifo)/sizeof(AVFilterBufferRef *) + ff_poll_frame(inlink);
 
378
    return av_fifo_size(buf->fifo)/FIFO_INIT_ELEMENT_SIZE + ff_poll_frame(inlink);
377
379
}
 
380
FF_ENABLE_DEPRECATION_WARNINGS
 
381
#endif
378
382
 
379
383
static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)
380
384
{