Project

General

Profile

Display of discription in ogg and flac almost implemented. Help needed.

Added by David Griffith 4 months ago

I think I've nearly implemented #714 to cause Audacious to display the DESCRIPTION field. My big hurdle now is that when I run Audacious and put the pointer over the list of files, I get this:

audacious: tuple.cc:473: void Tuple::set_int(Tuple::Field, int): Assertion `is_valid_field (field) && field_info[field].type == Int' failed.
Aborted

Using printf(), I found that this crash is caused by Tuple::set_int(Field field, int x) is called with field containing "Date". field["Date"].type is actually String. I can't seem to track down where Tuple::set_int() is called like this. I've set breakpoints and put printf()s before each call to no avail. I suspect something is going on with the number of fields not being what is expected, but I can't find where that's set either.

My work, so far, is at https://github.com/DavidGriffith/audacious. Please take a look and comment here.


Replies (10)

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by John Lindgren 4 months ago

I see that you added Description in the middle of the Tuple::Field enum. Since this is C++, doing that changes the integer value of all the following constants, and breaks the ABI (https://en.wikipedia.org/wiki/Application_binary_interface). Possibly what is happening is that a plugin is calling set_int(Track) -- but with the old value of Track, which is the same as the new value of Date. Try adding Description at the end, after FormattedTitle (but before n_fields), so that the values of the other constants remain the same.

The same goes for the Playlist::SortType enum.

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by David Griffith 4 months ago

Your mention of a plugin calling set_int(Track) made me think that perhaps I should rebuild audacious-plugins because the plugins have an outdated picture of the Tuple::Field enum. Now Audacious isn't crashing anymore. I should have the loose ends tied up in a day or two.

What is the procedure for submitting patches to Audacious?

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by John Lindgren 3 months ago

If you need to recompile audacious-plugins, you've broken ABI, which is generally unacceptable unless you can make a really good argument for doing so. You should be able to add the new enum constant at the end, as I suggested, without breaking ABI (n_fields is allowed to increase).

The easiest way to submit patches nowadays is a pull request on GitHub.

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by David Griffith 3 months ago

I did have to edit src/flac/metadata.cc and rc/vorbis/vorbis.cc in audacious-plugins in order for the DESCRIPTION field to get into the Audacious core itself. See https://github.com/DavidGriffith/audacious-plugins for my changes. It's made up of two new lines for FLAC and one line for OGGV. Would that be a good enough argument?

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by John Lindgren 3 months ago

You can extend the ABI (i.e. add Description at the end, and update the plugins to use it) as long as you don't break the ABI (i.e. the old plugins still need to run without crashing).

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by David Griffith 3 months ago

So, my changes in audacious-plugins don't change the ABI?

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by David Griffith 3 months ago

I think I got it now. I built and installed Audacious and the plugins prior to my changes. Then I built and installed Audacious with my changes and your suggested changes. That works fine. Running Audacious at this point works fine too. As expected, mentions of the track's description are entirely missing because the necessary changes in the plugin code are missing. Building and installing the plugins with my changes allows descriptions to be mentioned.

I now need to add support for track description to the QT interface and other places in the code. When that's done, I'll come back for a final check-over.

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by David Griffith 3 months ago

It's all done but for two problems I can't figure out. Please help. Under Playlist->Sort and Playlist->Sort_Selected are parameters such as "By track number" and "By Title". I can't seem to get my changes in audacious-plugins to show up there. Also, I don't know if I did sort_description() right.

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by John Lindgren 3 months ago

Which UI are you running? It looks like you added menu entries for sorting in the Winamp-style interfaces (skins and skins-qt) but not the "modern" interfaces (gtkui and qtui). Is that the problem, or are you not seeing your new entries in the Winamp interfaces either?

RE: Display of discription in ogg and flac almost implemented. Help needed. - Added by David Griffith 9 days ago

I think I have it done now. There's still a problem with the sort menus not working right. So, I'd like to get this pulled in and let some other people have a crack at fixing the sort stuff.

    (1-10/10)