[vlc-devel] Trac #3234 (autodetect subtitles)

bumszakalaka at poczta.onet.pl bumszakalaka at poczta.onet.pl
Sat Jan 30 16:09:44 CET 2010


Hello everyone (it's my first message ;) ),
so, I've been trying to fix the autodetect subtitles feature on MS  
Windows. The problem is, that in 1.0.5 branch the p_input in
Init (input/input.c) is in format:  
D:\\Downloads\\01\\My%20Name%20Is%20.avi, but in the 1.1.0 branch:  
file:///D:/Downloads/02/My%20Name%20Is%20.avi.
So the string is going through LoadSubtitles (input.c)

1018         char **ppsz_subs = subtitles_Detect( p_input, psz_autopath,
1019                                               
p_input->p->p_item->psz_uri );

to (input/subtitles.c)
249 char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
250                          const char *psz_name_org )

line: 265     if( !strncmp( psz_name_org, "file://", 7 ) )
makes with our string sth like that:
/D:/Downloads/02/My%20Name%20Is%20.avi
and now, everything breakes.  vlc media player always looks for subtitles  
in it's starting directory, because that if below is always false:
276     tmp = strrchr( psz_fname, DIR_SEP_CHAR );
277     if( tmp )

My solution is to cut first element, and replace every '/' occurence with  
'\\'. But I'm not sure if that is so simple, I can't compile it and test  
on my laptop, because it would last few hours. Besides, my solution doesn'  
cover:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Ticket-3234-autodetect-subtitles-fix.patch
Type: text/x-diff
Size: 1556 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100130/0dcd6e45/attachment.patch>


More information about the vlc-devel mailing list