Opened 3 months ago

Last modified 3 months ago

#10869 new defect

regression in mime-type parsing of http streams with audio/L16 Content-Type

Reported by: bubbleguuum Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by bubbleguuum)

http streams whose Content-Type is audio/L16 are not properly handled anymore, always resulting in this error (for example, as a result of 'ffmpeg -i http://path/to/L16/stream'):

[s16be @ 0xb400006f8e24c7f0] Invalid sample_rate found in mime_type "audio/L16"

Such streams have a mime-type with "rate" and "channels" parameters. For example:

Content-Type: audio/L16;rate=44100;channels=2

This error is from pcmdec.c as it cannot find the "rate" parameter to parse.

That's because it is passed the mime-type without its parameters in http.c, a change that happened in this commit from 8 months ago:

https://github.com/FFmpeg/FFmpeg/commit/0cd2e7dcfbc835f4519f1b2b7da6bd902dbb0190

It can be fixed in two ways:

  • revert that commit and let components making use of "mime-type" handle it properly if it has parameters (so according to this commit's description, modify the HLS component to handle the eventual mime-type params)
  • add an exception for audio/l16:
if (av_strncasecmp(p, "audio/l16", 9) == 0) {
    s->mime_type = av_strdup(p);
} else {
    s->mime_type = av_get_token((const char **)&p, ";");
}

Change History (1)

comment:1 by bubbleguuum, 3 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.