summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-07-12 11:31:03 -0700
committerJohn Stebbins <[email protected]>2019-08-11 15:54:27 -0700
commit93bbc62c454274b8be23705e10438fc0ee31ac24 (patch)
tree0f239a1b6612407259d28bf5d9f04f3ecf637477 /libhb/stream.c
parent7e5b372eeb3db720b0bc22419f621f40eff6dd87 (diff)
libhb: eliminate file path length limits
Diffstat (limited to 'libhb/stream.c')
-rw-r--r--libhb/stream.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index 320b53ec4..fb0fbeb2b 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -813,7 +813,7 @@ static void prune_streams(hb_stream_t *d)
*
**********************************************************************/
hb_stream_t *
-hb_stream_open(hb_handle_t *h, char *path, hb_title_t *title, int scan)
+hb_stream_open(hb_handle_t *h, const char *path, hb_title_t *title, int scan)
{
if (title == NULL)
{
@@ -1052,9 +1052,11 @@ hb_title_t * hb_stream_title_scan(hb_stream_t *stream, hb_title_t * title)
title->type = HB_STREAM_TYPE;
// Copy part of the stream path to the title name
- char *sep = hb_strr_dir_sep(stream->path);
+ char * name = stream->path;
+ char * sep = hb_strr_dir_sep(stream->path);
if (sep)
- strcpy(title->name, sep+1);
+ name = sep + 1;
+ title->name = strdup(name);
char *dot_term = strrchr(title->name, '.');
if (dot_term)
*dot_term = '\0';
@@ -5685,9 +5687,11 @@ static hb_title_t *ffmpeg_title_scan( hb_stream_t *stream, hb_title_t *title )
title->type = HB_FF_STREAM_TYPE;
// Copy part of the stream path to the title name
- char *sep = hb_strr_dir_sep(stream->path);
+ char * name = stream->path;
+ char * sep = hb_strr_dir_sep(stream->path);
if (sep)
- strcpy(title->name, sep+1);
+ name = sep + 1;
+ title->name = strdup(name);
char *dot_term = strrchr(title->name, '.');
if (dot_term)
*dot_term = '\0';