[FFmpeg-devel] [PATCH] lavf: add tee pseudo-muxer.

Michael Niedermayer michaelni at gmx.at
Wed Feb 6 19:07:18 CET 2013


On Sat, Jan 26, 2013 at 08:34:50PM +0100, Nicolas George wrote:
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  Changelog                |    1 +
>  doc/muxers.texi          |   35 ++++++
>  libavformat/Makefile     |    1 +
>  libavformat/allformats.c |    1 +
>  libavformat/tee.c        |  278 ++++++++++++++++++++++++++++++++++++++++++++++
>  libavformat/version.h    |    4 +-
>  6 files changed, 318 insertions(+), 2 deletions(-)
>  create mode 100644 libavformat/tee.c
> 
> 
> Rebased on top of current Git, adapted for API changes, fixed the format
> incompatibilities in the example.
[...]
> +static int open_slave(AVFormatContext *avf, char *slave, AVFormatContext **ravf)
> +{
> +    int i, ret;
> +    AVDictionary *options = NULL;
> +    AVDictionaryEntry *entry;
> +    char *filename;
> +    char *format = NULL;
> +    AVFormatContext *avf2 = NULL;
> +    AVStream *st, *st2;
> +
> +    if ((ret = parse_slave_options(avf, slave, &options, &filename)) < 0)
> +        return ret;
> +    if ((entry = av_dict_get(options, "f", NULL, 0))) {
> +        format = entry->value;
> +        entry->value = NULL; /* prevent it from being freed */
> +        av_dict_set(&options, "f", NULL, 0);
> +    }
> +
> +    avformat_alloc_output_context2(&avf2, NULL, format, filename);
> +    if (ret < 0)
> +        goto fail;

> +    av_free(format);

i suggest av_freep() for saftey

otherwise it should be ok if it works

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

Avoid a single point of failure, be that a person or equipment.
-------------- 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/20130206/b0a18c2a/attachment.asc>


More information about the ffmpeg-devel mailing list