On 15/01/13 10:16, Alexandra Khirnova wrote:
> From: Clément Bœsch <[email protected]>

dvdsubdec: parse the subtitle size from extradata

> ---
>  libavcodec/dvdsubdec.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
> index e39d853..f7b9796 100644
> --- a/libavcodec/dvdsubdec.c
> +++ b/libavcodec/dvdsubdec.c
> @@ -22,6 +22,7 @@
>  #include "get_bits.h"
>  #include "dsputil.h"
>  #include "libavutil/colorspace.h"
> +#include "libavutil/imgutils.h"
>  
>  //#define DEBUG
>  
> @@ -524,6 +525,11 @@ static int dvdsub_init(AVCodecContext *avctx)
>                  while (*p == ',' || isspace(*p))
>                      p++;
>              }
> +        } else if (strncmp("size:", data, 5) == 0) {
> +            int w, h;

av_parse_video_size might work for the purpose.

> +            if (sscanf(data + 5, "%dx%d", &w, &h) == 2 &&
> +                av_image_check_size(w, h, 0, avctx) >= 0)
> +                avcodec_set_dimensions(avctx, w, h);
>          }
>          cur += strcspn(pos, "\n\r");
>          cur += strspn(pos, "\n\r");
> 


_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to