Re: [Rhythmbox-devel] flac audio format support



Kevin Hunter <hunteke earlham edu> writes:

> At 9:35a -0400 on Mon, 11 Aug 2008, Peter wrote:
>> 2008/8/11 Felix Corrales <felixcorrales yahoo com>:
>>> Please include a .flac audio format support in rhythmbox.
>> 
>> Rhythmbox does support flac - you just need to install the relevant
>> bits of gstreamer.  How you do that will depend on which Linux
>> distribution are you using.
>
> I've heard this thrust of question get asked more often, both here and
> offlist.  If Rhythmbox can't play the file, what's the barrier to some
> simple code that determines what codec they need to install?
>
> # pseudocode
>
> if not file.is_playing()
>    if 'mp3' == file.type()
>       msg = 'Install gstreamer-bad-set'
>    elsif 'flac' == file.type()
>       msg = 'Install gstreamer-flac-set'
>    ...
>
>    msg_to_user( msg )
>
> Or something like that.  A thought.

Basically (if I may jump in here, as a complete Rhythmbox n00b, but an
experienced developer,) because defensive coding is bad:

What if the file *is* an mp3 or flac, and there is some other reason it
can not be played (and I'm glossing over the fact that there is almost
certainly nothing like a file.is_playing() method to see whether
everything is alright, that's mostly just not the way code works, it
either errors out earlier, or it is playing) now the user gets a message
saying to install something that will almost certainly not solve his or
her problem. The best thing is to let the original error bubble up as
near as possible to the end user, before catching and interpreting
it. Pragmatically though, sometimes failing silently is better than
throwing lots of errors (i.e. when importing a directory with possibly
thousands of files the player won't be able to play.) The choice there
is to bail out on the first error, or silently continue, and maybe log
the problems to the console or a log file.

Maybe this is less than ideal, but we live in a less than Panglossian
world, and if people run a system that has no way to a interpret a
certain type of file, it is unrealistic to expect a player like
Rhythmbox to solve this problem. (unless players become huge monolithic
software that come with their own codecs, which would be even worse:
then you would have to ensure flac/mp3/nanunanu support for every
single player.)

-- 
- eric casteleijn
http://thisfred.blogspot.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]