[FFmpeg-devel] [PATCH] Add MPL2 subtitles demuxer and decoder.

Paul B Mahol onemda at gmail.com
Sat Dec 29 13:13:08 CET 2012


On 12/27/12, Clement Boesch <ubitux at gmail.com> wrote:
> ---
>  Changelog                |   1 +
>  doc/general.texi         |   1 +
>  libavcodec/Makefile      |   1 +
>  libavcodec/allcodecs.c   |   1 +
>  libavcodec/avcodec.h     |   1 +
>  libavcodec/mpl2dec.c     |  94 +++++++++++++++++++++++++++++
>  libavcodec/version.h     |   2 +-
>  libavformat/Makefile     |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/mpl2dec.c    | 150
> +++++++++++++++++++++++++++++++++++++++++++++++
>  libavformat/version.h    |   4 +-
>  tests/fate/subtitles.mak |   3 +
>  tests/ref/fate/sub-mpl2  |   1 +
>  13 files changed, 258 insertions(+), 3 deletions(-)
>  create mode 100644 libavcodec/mpl2dec.c
>  create mode 100644 libavformat/mpl2dec.c
>  create mode 100644 tests/ref/fate/sub-mpl2
>

[...]

> +    return 0;
> +}
> +
> +static int mpl2_decode_frame(AVCodecContext *avctx, void *data,
> +                             int *got_sub_ptr, AVPacket *avpkt)
> +{
> +    AVBPrint buf;
> +    AVSubtitle *sub = data;
> +    const char *ptr = avpkt->data;
> +    const int ts_start     = av_rescale_q(avpkt->pts,
> avctx->time_base, (AVRational){1,100});
> +    const int ts_duration  = avpkt->duration != -1 ?

AV_NOPTS_VALUE ?

> +                             av_rescale_q(avpkt->duration,
> avctx->time_base, (AVRational){1,100}) : -1;
> +
> +    av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);

[...]


More information about the ffmpeg-devel mailing list