Skip to content

Bitrate info is missing for AAC/FAAD2 handled online streams [PATCH AVAILABLE] #1836

Description

@birdie-github

This patch requires a patch from #1835 first.

This patch adds real-time bitrate estimation for raw AAC streams handled by the FAAD/AAC input plugin.

Currently, AAC stream bitrate may be missing or may depend on server-provided metadata. For live streams, server metadata such as icy-br can be absent, stale, misleading, or simply not representative of the actual encoded data being received. This is especially undesirable for VBR AAC streams.

The patch deliberately ignores server-provided bitrate metadata for AAC playback and instead estimates the bitrate from the actual decoded stream.

Implementation summary:

  • Adds a small 3-second measurement window.
  • Accumulates NeAACDecFrameInfo::bytesconsumed, i.e. how many encoded bytes FAAD consumed.
  • Accumulates decoded audio duration using NeAACDecFrameInfo::samples, channels, and samplerate.
  • Computes bitrate as:
encoded bytes consumed * 8 / decoded duration
  • Calls set_stream_bitrate() with the estimated runtime bitrate.
  • Updates Tuple::Bitrate so the playlist bitrate column can be populated during playback.
  • Avoids excessive UI churn by only updating the tuple when the displayed bitrate changes by at least 5 kbit/s.
  • Clears Tuple::Bitrate initially if no reliable bitrate is known yet, so Audacious does not display server-provided or stale data before enough stream data has actually been decoded.

The intent is similar to classic Winamp-style real-time bitrate reporting: show the bitrate of the actual stream being decoded, rather than trusting headers or server metadata.

This is particularly useful for online AAC streams where the nominal server-advertised bitrate may not match the real stream, and for VBR AAC streams where bitrate naturally changes over time.

audacious-plugins-ffaudio-format-metadata-v2-streams.patch

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions