Project

General

Profile

Support #1176

Still can't play certain OGG flac streams with Audacious 4.2

Added by Artem S. Tashkinov about 2 months ago. Updated 20 days ago.

Status:
Closed
Priority:
Minor
Assignee:
-
Category:
-
Target version:
-
Start date:
August 02, 2022
Due date:
% Done:

0%

Estimated time:
Affects version:

Description

I though Audacious 4.2 has them fixed but no, I cannot play this stream:

http://joyhits.online/joyhits.flac.ogg

probe.cc.diff (3.42 KB) probe.cc.diff Jim Turner, August 07, 2022 04:50

History

#2 Updated by John Lindgren about 2 months ago

  • Tracker changed from Bug to Support

#3 Updated by Jim Turner about 2 months ago

This is indeed a pbm, as the stream matches first by extension (2 - vorbis & ffaudio) causing mime to be checked, which then matches ("*/ogg") in which vorbis grabs, but fails to play (not vorbis). This is very similar to the issue in issue #1160 (except that one's for an ogg-wrapped opus stream, vs an ogg-wrapped flac stream here). I believe the solution is the same: Make sure for vorbis, we always call "is_our_file()" to validate while probing, and for flac, we also need to do a special pre-probe to verify it is indeed flac data wrapped in ogg-mimed entries. Please see attached patch proposal that seems to address both issues and feel free to test, use, modify, correct (or replace) as you see best.

Thanks,

Jim

#4 Updated by Artem S. Tashkinov about 2 months ago

Jim Turner wrote:

This is indeed a pbm, as the stream matches first by extension (2 - vorbis & ffaudio) causing mime to be checked, which then matches ("*/ogg") in which vorbis grabs, but fails to play (not vorbis). This is very similar to the issue in issue #1160 (except that one's for an ogg-wrapped opus stream, vs an ogg-wrapped flac stream here). I believe the solution is the same: Make sure for vorbis, we always call "is_our_file()" to validate while probing, and for flac, we also need to do a special pre-probe to verify it is indeed flac data wrapped in ogg-mimed entries. Please see attached patch proposal that seems to address both issues and feel free to test, use, modify, correct (or replace) as you see best.

I'm confused about this string:

    if (!file.fseek(0, VFS_SEEK_SET) && file.fread(buf, 1, sizeof buf) == sizeof buf

Are you sure it's not

sizeof(buf)
?

Secondly,

    || !strncmp(buf+29, "flac", 4)))  // Need a "strncmp_nocase()" here!

There's strncasecmp() exactly for that.

#5 Updated by Artem S. Tashkinov about 2 months ago

I've applied the patch, only changed:

                    if ( !file.fseek(0, VFS_SEEK_SET)
                            && file.fread(buf, 1, sizeof buf) == sizeof buf
                            && !strncasecmp(buf+29, "flac", 4) )
                        return plugin;  // will use flac plugin.

And everything works. Thanks a ton.

#6 Updated by John Lindgren about 2 months ago

The generic fix for multiple plugins handling the same MIME-type in #1160 applies here as well.
In addition, we need one of the plugins supporting Ogg FLAC to declare support for the audio/ogg MIME-type.
I've added that to the ffaudio plugin here as a quick fix:
https://github.com/audacious-media-player/audacious-plugins/commit/996c9d336cc5f11c875888510004ca349b5d16e7

There is a still a TODO in the FLAC plugin's is_our_file() that needs to be addressed to get it working properly with Ogg FLAC streams.

#7 Updated by Jim Turner about 2 months ago

@Artem - Thanks for the strncasecmp() tip (I'm not a C expert, just good enough to get around in C-code & be dangerous, mostly just making small modifications and ocassionally writing tiny programs - I retired programming in Perl)! ;) Now, the "sizeof buf" argument, I copied that verbatum from another plugin, and grepping, it's this way in at least TEN of 'em?! :O Maybe John could shed some light on whether "sizeof buf" == "sizeof(buf)"? The compiler doesn't complain & it seemed to work. Anyway, glad the patch is working for you (and thanks for testing), but pbly best to watch for Audacious to implement or decide the best way to fix.

Regards,

Jim

#8 Updated by Artem S. Tashkinov about 2 months ago

Jim Turner wrote:

This is indeed a pbm, as the stream matches first by extension (2 - vorbis & ffaudio) causing mime to be checked, which then matches ("*/ogg") in which vorbis grabs, but fails to play (not vorbis). This is very similar to the issue in issue #1160 (except that one's for an ogg-wrapped opus stream, vs an ogg-wrapped flac stream here). I believe the solution is the same: Make sure for vorbis, we always call "is_our_file()" to validate while probing, and for flac, we also need to do a special pre-probe to verify it is indeed flac data wrapped in ogg-mimed entries. Please see attached patch proposal that seems to address both issues and feel free to test, use, modify, correct (or replace) as you see best.

I spoke too soon:

http://joyhits.online/joyhits.flac.ogg -> "Error playing http://joyhits.online/joyhits.flac.ogg: The file could not be decoded. It may be invalid, corrupt, or in an unsupported format."

Waiting for proper patches from John.

#9 Updated by John Lindgren about 1 month ago

http://joyhits.online/joyhits.flac.ogg is working for me with:
  • audacious @ 6415fe428e1583b624b5ba0bfe864af9fe87b620
  • audacious-plugins @ 79df25fc23e3bb8502ca60eb9e2c497c299fe7be

#10 Updated by Artem S. Tashkinov about 1 month ago

John Lindgren wrote:

http://joyhits.online/joyhits.flac.ogg is working for me with:
  • audacious @ 6415fe428e1583b624b5ba0bfe864af9fe87b620
  • audacious-plugins @ 79df25fc23e3bb8502ca60eb9e2c497c299fe7be

I've applied commits 6415fe428e1583b624b5ba0bfe864af9fe87b620 and 996c9d336cc5f11c875888510004ca349b5d16e7 to 4.2 and it still doesn't work for me. What am I missing?

#11 Updated by John Lindgren about 1 month ago

I would suggest pulling the latest git master branches. It's too difficult to guess what other commits you may be missing otherwise.

Also make sure that the ffaudio plugin is installed and enabled.

#12 Updated by Thomas Lange about 1 month ago

John Lindgren wrote:

http://joyhits.online/joyhits.flac.ogg is working for me with:
  • audacious @ 6415fe428e1583b624b5ba0bfe864af9fe87b620
  • audacious-plugins @ 79df25fc23e3bb8502ca60eb9e2c497c299fe7be

For me as well, with latest audacious-git on Arch Linux.

#13 Updated by John Lindgren 20 days ago

  • Status changed from New to Closed

Closing since we have multiple data points that this is working in latest git.

Also available in: Atom PDF