A patch that I've found to work is simply to comment out the renaming portion and write directly to the m3u8 file rather than a tmp file, however while it may work in small tests, it's likely to cause some nasty stuff with the webserver if VLC is writing while the server is trying to read it. I'm not sure of the proper way of doing it to start with, so I can't really propose a fix. Also, it might depend on the server your using as well as the host OS as to what sort of reading while writing you can get away with. But hey, it's better than the "file not found" error.
Code: Select all
diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index b2c55f3..b44bbf3 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -247,7 +247,7 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
int val;
FILE *fp;
char *psz_idxTmp;
- if ( asprintf( &psz_idxTmp, "%s.tmp", p_sys->psz_indexPath ) < 0)
+ if ( asprintf( &psz_idxTmp, "%s", p_sys->psz_indexPath ) < 0)
return -1;
fp = vlc_fopen( psz_idxTmp, "wt");
@@ -297,15 +297,7 @@ static int updateIndexAndDel( sout_access_out_t *p_access, sout_access_out_sys_t
}
fclose( fp );
- val = vlc_rename ( psz_idxTmp, p_sys->psz_indexPath);
-
- if ( val < 0 )
- {
- vlc_unlink( psz_idxTmp );
- msg_Err( p_access, "Error moving LiveHttp index file" );
- }
- else
- msg_Info( p_access, "LiveHttpIndexComplete: %s" , p_sys->psz_indexPath );
+ msg_Info( p_access, "LiveHttpIndexComplete: %s" , p_sys->psz_indexPath );
free( psz_idxTmp );
}