[FFmpeg-devel] [WIP] libox wrapper

Michael Niedermayer michaelni at gmx.at
Sat Mar 23 22:23:52 CET 2013


On Thu, Mar 21, 2013 at 09:15:07PM +0100, Stefano Sabatini wrote:
> Hi,
> 
> this is a work in progress.
> 
> Still missing:
> - proper configuration of effects
> - drain
> - proper multi-channel support
> 
> Comments are welcome, even if I should probably ask some libsox guys
> for help.

[...]

> +static av_cold int init(AVFilterContext *ctx, const char *args)
> +{
> +    SoxContext *sox = ctx->priv;
> +    char **argv, *arg;
> +    int argc = 0, numargs = 0, ret = 0;
> +    char *args1 = av_strdup(args), *p;
> +    sox_encodinginfo_t *encoding;
> +    const sox_effect_handler_t *handler;
> +    char *saveptr;
> +
> +    if (!args1)
> +        return AVERROR(ENOMEM);
> +
> +#define FAIL(err) ret = err; goto end;
> +

> +    /* initialize SoX if necessary */
> +    if (soxinit == 0 && sox_init() != SOX_SUCCESS) {
> +        av_log(ctx, AV_LOG_ERROR, "Error when initing libsox: '%s'\n",
> +               sox_strerror(soxinit));
> +        FAIL(AVERROR_EXTERNAL);
> +    }
> +    soxinit++;

this is not thread safe, see avpriv_atomic_int_add_and_fetch()

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130323/7d06dfa4/attachment.asc>


More information about the ffmpeg-devel mailing list