mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
qtdemux: Try to infer useful header values for raw audio if the sound sample descriptions contain zero values
This commit is contained in:
parent
9e9af6711d
commit
885d330ee6
1 changed files with 27 additions and 0 deletions
|
@ -12163,6 +12163,33 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
|||
break;
|
||||
}
|
||||
/* fix up any invalid header information from above */
|
||||
case FOURCC_twos:
|
||||
case FOURCC_sowt:
|
||||
case FOURCC_raw_:
|
||||
case FOURCC_lpcm:
|
||||
/* Sometimes these are set to 0 in the sound sample descriptions so
|
||||
* let's try to infer useful values from the other information we
|
||||
* have available */
|
||||
if (entry->bytes_per_sample == 0)
|
||||
entry->bytes_per_sample =
|
||||
entry->bytes_per_frame / entry->n_channels;
|
||||
if (entry->bytes_per_sample == 0)
|
||||
entry->bytes_per_sample = samplesize / 8;
|
||||
|
||||
if (entry->bytes_per_frame == 0)
|
||||
entry->bytes_per_frame =
|
||||
entry->bytes_per_sample * entry->n_channels;
|
||||
|
||||
if (entry->bytes_per_packet == 0)
|
||||
entry->bytes_per_packet = entry->bytes_per_sample;
|
||||
|
||||
if (entry->samples_per_frame == 0)
|
||||
entry->samples_per_frame = entry->n_channels;
|
||||
|
||||
if (entry->samples_per_packet == 0)
|
||||
entry->samples_per_packet = entry->samples_per_frame;
|
||||
|
||||
break;
|
||||
case FOURCC_in24:
|
||||
case FOURCC_in32:
|
||||
case FOURCC_fl32:
|
||||
|
|
Loading…
Reference in a new issue