From 233f3ad8698383255fb8766e99647e87a88044fe Mon Sep 17 00:00:00 2001 From: Vignesh Venkatasubramanian Date: Thu, 9 Oct 2014 14:56:47 -0700 Subject: lavf/webm_dash: Allow filenames without directories Fix basename computation code to allow just file names without any directories in the path. Signed-off-by: Vignesh Venkatasubramanian Signed-off-by: Michael Niedermayer --- libavformat/matroskadec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libavformat') diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 105e1f4b20..b742319b9a 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3326,8 +3326,7 @@ static int webm_dash_manifest_read_header(AVFormatContext *s) // basename of the file buf = strrchr(s->filename, '/'); - if (!buf) return -1; - av_dict_set(&s->streams[0]->metadata, FILENAME, ++buf, 0); + av_dict_set(&s->streams[0]->metadata, FILENAME, buf ? ++buf : s->filename, 0); // duration buf = av_asprintf("%g", matroska->duration); -- cgit v1.2.3