[FFmpeg-devel] [PATCH 1/2] lavc/samidec: support multiple paragraphs in a packet

Michael Niedermayer michael at niedermayer.cc
Sat Oct 17 21:12:27 CEST 2015


On Sat, Oct 10, 2015 at 11:05:49PM -0500, Rodger Combs wrote:
> ---
>  libavcodec/samidec.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c
> index 95f35ab..8dd2749 100644
> --- a/libavcodec/samidec.c
> +++ b/libavcodec/samidec.c
> @@ -46,6 +46,7 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
>      char *p = dupsrc;
>      AVBPrint *dst_content = &sami->encoded_content;
>      AVBPrint *dst_source = &sami->encoded_source;
> +    int got_content = 0;
>  
>      av_bprint_clear(&sami->encoded_content);
>      av_bprint_clear(&sami->content);

> @@ -76,17 +77,18 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
>              av_bprint_clear(dst);
>          }
>  
> -        /* if empty event -> skip subtitle */
> -        while (av_isspace(*p))
> +        while (av_isspace(*p) || (!strncmp(p, " ", 6) && (p += 5)))
>              p++;
> -        if (!strncmp(p, " ", 6)) {
> -            ret = -1;
> -            goto end;
> -        }

this looks independant of the rest of te patch


>  
>          /* extract the text, stripping most of the tags */
>          while (*p) {
>              if (*p == '<') {
> +                if (!av_strncasecmp(p, "</P>", 4)) {
> +                    p += 4;
> +                    while (av_isspace(*p))
> +                        p++;

here av_isspace is used without checking for nbsp;, is that intended ?

otherwise this looks ok to someone (me) not knowing samidec deeper

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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151017/d2c00226/attachment.sig>


More information about the ffmpeg-devel mailing list