[MPlayer-dev-eng] [PATCH] stream layer support for .ifo files
Vladimir Voroshilov
voroshil at gmail.com
Mon Dec 17 17:03:15 CET 2007
On Dec 17, 2007 6:08 PM, Reimar Döffinger
<Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> Hello,
> On Mon, Dec 17, 2007 at 01:38:25PM +0600, Vladimir Voroshilov wrote:
> [...]
> > well. is implementation something like:
> >
> > idx=-1;
> > for(i=0;stream->url[i]; i++)
> > if(stream->url[i]=='/')
> > idx=i;
>
> Uh, never heard of strrchr? It is used just a few lines above for almost
> the same thing, just that it looks for '.' and not '/'.
> Probably this should also check for '\' and ':' if compiled for
> windows (or at least mingw, not sure about cygwin)...
Why should code search for ':' ? it can be an issue only if url is
like "C:VTS_01_1.IFO".
Current behaviour is playing such url as file://
Did i miss anything?
> > if(idx>=0)
> > {
> > filename=strdup(stream->url+idx+1);
> > dvd_device=malloc(idx);
> > strncpy(dvd_device,stream->url, idx);
>
> av_strlcpy is preferred since most people make the same error in strncpy
> usage as you just did (dvd_device will not be terminated correctly).
>
> > acceptable or hole patch should be reverted (lossing these feature)?
>
> Just replace it by one of the many implementations of this that probably
> already exist somewhere in MPlayer, or come up with something yourself :-)
>
>
What about attached patch?
I kept 'for' loop to avoid double call to strrchr under win32.
--
Regards,
Vladimir Voroshilov mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: basename_remove.diff
Type: application/octet-stream
Size: 1185 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071217/c1b8657b/attachment.obj>
More information about the MPlayer-dev-eng
mailing list