Finding Plugins: MPEG files not valid?

John M McIntosh johnmci at smalltalkconsulting.com
Fri Nov 30 18:52:56 UTC 2001


>I'm eager to try the Movie-JPEG format, but I can't get any MPEGs 
>converted to Movie-JPEG.  The problem isn't the JPEG plugin -- I 
>can't open any MPEGs!  I know that I used to be able to, but in a 
>completely-updated 3.2 image, running the 3.1.1 Mac VM (not OS X), 
>every MPEG or MP3 file I try comes back as being invalid MPEG. 
>These are files that I can successfully play in QT Movie Player and 
>in iTunes.
>
>I've been wondering if I even have the MPEG plugin -- maybe the 
>primitive is bombing because the module can't be found.  I've tried 
>downloading the MPEG plugin from www.squeak.org in the 
>3.0/mac/extra_files directory, but with the same result.
>
>Some questions:
>- Is there a more recent MPEG plugin somewhere?
>- Is the MPEG plugin built in to the Mac VM?  How can I find out?  I 
>know that there's a way of getting an array of all the available 
>plugins, but I can't find it anywhere in the image.
>- Are there specific MPEG versions that work or don't work?
>- Can anyone point me to valid MPEG files that Squeak can read that 
>I can try this?
>
>Thanks!
>   Mark
>--------------------------
>Mark Guzdial : Georgia Tech : College of Computing : Atlanta, GA 30332-0280
>Associate Professor - Learning Sciences & Technologies.
>Collaborative Software Lab - http://coweb.cc.gatech.edu/csl/
>(404) 894-5618 : Fax (404) 894-0673 : guzdial at cc.gatech.edu
>http://www.cc.gatech.edu/gvu/people/Faculty/Mark.Guzdial.html

Mpeg3PluginV1.1.sit is the latest mac version. I do also have a carbon version.

The MPEG plugin isn't built into the VM, it's a plugin, but you could 
build it in if you want using VMMaker.

V1.1 of the plugin contains some optimizations that make some major 
improvements in performance, otherwise the code base to 1.0 is the 
same.

I think the problem you are having is due to a careless coding issue 
I introduced when porting. It seems the compare for valid mpeg files 
is case sensitive!

/* Test file extension. */
			if(strncasecmp(ext, ".mp2", 4) &&
				strncasecmp(ext, ".mp3", 4) &&
				strncasecmp(ext, ".m1v", 4) &&
				strncasecmp(ext, ".m2v", 4) &&
				strncasecmp(ext, ".m2s", 4) &&
				strncasecmp(ext, ".mpg", 4) &&
				strncasecmp(ext, ".vob", 4) &&
				strncasecmp(ext, ".mpeg", 4) /* JMM &&
				strncasecmp(ext, ".ac3", 4) */)
				result = 0;
		}

The strncasecmp that was coded up actually is case sensitive. Therefore a file
foo.MP3 wouldn't be considered as valid, but foo.mp3 would. I'm 
considering dropping this check in the C code. It should be made in 
Smalltalk and besides the C code also does magic number checks to see 
if the file appears to be a mp3 file so it's really redundant to also 
check the extension.

-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================




More information about the Squeak-dev mailing list