Ticket #2139: 2139.patch

File 2139.patch, 1.0 KB (added by Hari, 13 years ago)
  • libavformat/img2enc.c

    diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
    index 67b5819..a816ac5 100644
    a b typedef struct {  
    3939    int updatefirst;
    4040} VideoMuxData;
    4141
     42#define URL_SCHEME_CHARS                        \
     43    "abcdefghijklmnopqrstuvwxyz"                \
     44    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"                \
     45    "0123456789+-."
     46
     47
    4248static int write_header(AVFormatContext *s)
    4349{
    4450    VideoMuxData *img = s->priv_data;
    static int write_packet(AVFormatContext *s, AVPacket *pkt)  
    7480    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(codec->pix_fmt);
    7581    int i;
    7682
     83        if(strstr(img->path, "concat"))
     84        {
     85                size_t proto_len = strspn(img->path, URL_SCHEME_CHARS);
     86
     87                if(img->path[proto_len] == ':')
     88                        img->path[proto_len] = '_';             
     89        }
     90
    7791    if (!img->is_pipe) {
    7892        if (av_get_frame_filename(filename, sizeof(filename),
    7993                                  img->path, img->img_number) < 0 && img->img_number > 1 && !img->updatefirst) {