Skip to content

Only report ID3 when the content changes#476

Open
argilo wants to merge 1 commit intomasterfrom
unique-id3
Open

Only report ID3 when the content changes#476
argilo wants to merge 1 commit intomasterfrom
unique-id3

Conversation

@argilo
Copy link
Collaborator

@argilo argilo commented Jan 5, 2026

Fixes #429.

In general, libnrsc5 reports events only when the corresponding data values change. This avoids burdening applications with duplicate events, and cuts down on the amount of information that the command-line applications log.

But until now, ID3 events did not get this treatment. Every ID3 tag in the PSD stream was reported, even if it was the same as the last one. In some cases, multiple events were reported back-to-back because a single PDU can contain multiple ID3 tags.

Here I've changed libnrsc5 so that it only reports ID3 events when the PSD data changes. This roughly halves the amount of information logged by the command-line applications.

@argilo
Copy link
Collaborator Author

argilo commented Jan 5, 2026

@TheDaChicken noticed two issues:

  1. output_reset leaks memory because it fails to free last_psd. I'll fix this by adding the missing free.
  2. When switching between programs using keyboard commands in the CLI apps, the current PSD information is not printed. To solve this, I suppose the CLI apps will have to store the most recent PSD information for each program. A getter function in the API (as proposed in Getters for event data?  #462) could make this easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't report duplicate ID3 tags in the API?

1 participant