diff mbox series

[FFmpeg-devel,3/6] avformat/hlsenc: Don't cast const away

Message ID 20200509191509.9812-3-andreas.rheinhardt@gmail.com
State Accepted
Commit 940601616e4f39d7aa9da20a5e0b5e943b9ac2ca
Headers show
Series [FFmpeg-devel,1/6] avformat/hlsenc: Don't reset AVIOContext pointer manually a second time
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 9, 2020, 7:15 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/hlsenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Steven Liu May 10, 2020, 2:02 a.m. UTC | #1
> 2020年5月10日 上午3:15,Andreas Rheinhardt <andreas.rheinhardt@gmail.com> 写道:
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> libavformat/hlsenc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index afb4d2a0c0..2a0d17baea 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -525,10 +525,10 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
>     int ret = 0;
>     int segment_cnt = 0;
>     AVBPrint path;
> -    char *dirname = NULL;
> +    const char *dirname = NULL;
>     char *dirname_r = NULL;
>     char *dirname_repl = NULL;
> -    char *vtt_dirname = NULL;
> +    const char *vtt_dirname = NULL;
>     char *vtt_dirname_r = NULL;
>     const char *proto = NULL;
> 
> @@ -559,7 +559,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
> 
>     if (segment && !hls->use_localtime_mkdir) {
>         dirname_r = hls->segment_filename ? av_strdup(hls->segment_filename): av_strdup(vs->avf->url);
> -        dirname = (char*)av_dirname(dirname_r);
> +        dirname = av_dirname(dirname_r);
>     }
> 
>     /* if %v is present in the file's directory
> @@ -598,7 +598,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
> 
>         if ((segment->sub_filename[0] != '\0')) {
>             vtt_dirname_r = av_strdup(vs->vtt_avf->url);
> -            vtt_dirname = (char*)av_dirname(vtt_dirname_r);
> +            vtt_dirname = av_dirname(vtt_dirname_r);
> 
>             av_bprint_clear(&path);
>             av_bprintf(&path, "%s%c%s", vtt_dirname, SEPARATOR,
> -- 
> 2.20.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

LGTM

Thanks

Steven Liu
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index afb4d2a0c0..2a0d17baea 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -525,10 +525,10 @@  static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
     int ret = 0;
     int segment_cnt = 0;
     AVBPrint path;
-    char *dirname = NULL;
+    const char *dirname = NULL;
     char *dirname_r = NULL;
     char *dirname_repl = NULL;
-    char *vtt_dirname = NULL;
+    const char *vtt_dirname = NULL;
     char *vtt_dirname_r = NULL;
     const char *proto = NULL;
 
@@ -559,7 +559,7 @@  static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
 
     if (segment && !hls->use_localtime_mkdir) {
         dirname_r = hls->segment_filename ? av_strdup(hls->segment_filename): av_strdup(vs->avf->url);
-        dirname = (char*)av_dirname(dirname_r);
+        dirname = av_dirname(dirname_r);
     }
 
     /* if %v is present in the file's directory
@@ -598,7 +598,7 @@  static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
 
         if ((segment->sub_filename[0] != '\0')) {
             vtt_dirname_r = av_strdup(vs->vtt_avf->url);
-            vtt_dirname = (char*)av_dirname(vtt_dirname_r);
+            vtt_dirname = av_dirname(vtt_dirname_r);
 
             av_bprint_clear(&path);
             av_bprintf(&path, "%s%c%s", vtt_dirname, SEPARATOR,