qtdemux: Fix up header information for various fixed-format raw audio formats

Sometimes the headers contain useless, wrong or zero values for e.g. the
sample size with these formats. There's only a single valid value for
them so let's set these instead.
This commit is contained in:
Sebastian Dröge 2020-02-28 13:59:42 +02:00 committed by GStreamer Merge Bot
parent 2c5f6e508c
commit 67be373221

View file

@ -12161,6 +12161,36 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
entry->bytes_per_sample = 2;
entry->samples_per_frame = 160 * entry->n_channels;
break;
}
/* fix up any invalid header information from above */
case FOURCC_in24:
case FOURCC_in32:
case FOURCC_fl32:
case FOURCC_fl64:
case FOURCC_s16l:{
switch (fourcc) {
case FOURCC_in24:
entry->bytes_per_sample = 3;
break;
case FOURCC_in32:
case FOURCC_fl32:
entry->bytes_per_sample = 4;
break;
case FOURCC_fl64:
entry->bytes_per_sample = 8;
break;
case FOURCC_s16l:
entry->bytes_per_sample = 2;
break;
default:
g_assert_not_reached ();
break;
}
entry->samples_per_frame = entry->n_channels;
entry->bytes_per_frame = entry->n_channels * entry->bytes_per_sample;
entry->samples_per_packet = entry->samples_per_frame;
entry->bytes_per_packet = entry->bytes_per_sample;
break;
}
default:
break;