[MPlayer-dev-eng] [PATCH] stream layer support for .ifo files

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Dec 17 13:08:12 CET 2007


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)...

> 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 :-)

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list