Failure to choose highest bitrate in mmsh streams with multiple bitrates

Bug #381782 reported by Paul Fleischer
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Won't Fix
Fix Released

Bug Description

The Danish National radio broadcasts its netradio in three bitrates: 128904, 64896, 32844

When using libmms to playback the stations, the lowest bitrate is chosen.

The easiest way to reproduce this is to compile libmms with debug enabled, and use gst-launch with the mmssrc (from the GStreamer plugins bad package):
gst-launch-0.10 mmssrc location="mmsh://" ! decodebin ! alsasink

Amongst the debug output are the following lines:

GUID: stream bitrate properties
stream bitrate properties
streams 3
stream id 1
mmsh: stream id 1, bitrate 128904
stream id 2
mmsh: stream id 2, bitrate 64896
stream id 3
mmsh: stream id 3, bitrate 32844
length : 44
GUID: file properties
file object, packet length = 5493 (5493)
length : 104
GUID: header extension
unknown object
length : 4719
GUID: stream header
GUID: audio media
stream object, stream id: 3, type: 1, encrypted: 0
length : 114
GUID: extended content description
unknown object
length : 164
GUID: codec list
unknown object
length : 174

From this i reckon that the three bitrates are correctly identified. But it seems that only a single audio stream is found -- the last one with the lowest quality.

Revision history for this message
Paul Fleischer (paul-xpg) wrote :

I just couldn't keep my mind off this problem, and now I know what is wrong.
The problem seems to be that the way that multiple bitrate streams are only supported in newer versions of ASF.
Therefore the stream properties header for all but one of the streams is hidden away in an extended header. The point is that any old player supporting older version of ASF will still work, but only with the single stream which has its stream properties header outside the extension header. Obviously, the Danish National Radio has chosen to use the lowest bitrate stream for older players.

I have hacked together the attached patch, which should enabled libmms to support multiple bitrate URLs. It's getting rather late here, so chances are that the patch is filled with exciting errors :-)

Oh, and when the patch has been applied, I can playback the URL mentioned previously in much better quality:

gst-launch-0.10 mmssrc location="mmsh://" ! ffdemux_asf ! decodebin ! alsasink

For some strange reason the ffdemux_asf element is needed, else it won't play back. I'm pretty sure that it is unrelated to libmms, but I'll wait to investigate further till I have gotten some sleep :-)


Revision history for this message
Anssi Hannula (anssi-hannula) wrote :

FYI, Tony Tung apparently created a similar patch back in 2008:

Though by a quick look your patch looks better.

For the record, says that is also affected, but I'm pretty sure these are not the only ones ;)

Revision history for this message
Soren Hansen (soren) wrote :

Sorry about taking so long to look at this. Your patch looks good, thanks a lot!

Changed in debian:
status: Unknown → New
Changed in debian:
status: New → Fix Released
Revision history for this message
Soren Hansen (soren) wrote :

Thanks for helping make libmms better! I've found myself unable to give libmms the love and care it needs, so I've passed maintainership over to Hans de Goede who has chosen to maintain the project on SourceForge instead of Launchpad. As such, I'm closing this bug. I encourage you to file this bug on the libmms bug tracker on SourceForge instead:

Changed in libmms:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.