[FFmpeg-devel] Image sequence file names

Georgi Chorbadzhiyski gf at unixsol.org
Tue Aug 30 22:52:04 CEST 2011


On 8/30/11 10:34 PM, Robert Petka wrote:
> +static void get_directory_from_path(const char* inPath, char* dirPath, int buffsize)
> +{
> +    int length, i;
> +    length = strlen(inPath);
> +
> +    for(i=length-1;i>=0;i--)
> +        if(inPath[i] == '\\' || inPath[i] =='/')
> +            break;
> +
> +    if(i == -1) {
> +        /* Files are in same directory as application */
> +        snprintf(dirPath, buffsize,"./");
> +    } else {
> +        av_strlcpy(dirPath, inPath, i + 1);
> +        dirPath[i + 1] = '\0';
> +    }
> +}

This looks like dirname(3) /man 3 dirname/ Can you use it?

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/


More information about the ffmpeg-devel mailing list