gst/matroska/matroska-mux.c: Fix muxing of MP3/MP2 with different MPEG versions by calculating the duration of a fram...
Original commit message from CVS: * gst/matroska/matroska-mux.c: (gst_matroska_mux_audio_pad_setcaps): Fix muxing of MP3/MP2 with different MPEG versions by calculating the duration of a frame with the new mpegaudioversion caps field.
This commit is contained in:
parent
d43e67fa70
commit
aedf04f957
@ -1,3 +1,10 @@
|
|||||||
|
2008-08-02 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/matroska/matroska-mux.c:
|
||||||
|
(gst_matroska_mux_audio_pad_setcaps):
|
||||||
|
Fix muxing of MP3/MP2 with different MPEG versions by calculating the
|
||||||
|
duration of a frame with the new mpegaudioversion caps field.
|
||||||
|
|
||||||
2008-08-02 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2008-08-02 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
* gst/matroska/matroska-demux.c: (gst_matroska_demux_finalize),
|
* gst/matroska/matroska-demux.c: (gst_matroska_demux_finalize),
|
||||||
|
@ -978,27 +978,38 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||||||
switch (mpegversion) {
|
switch (mpegversion) {
|
||||||
case 1:{
|
case 1:{
|
||||||
gint layer;
|
gint layer;
|
||||||
|
gint version = 1;
|
||||||
/* FIXME: number of samples per frame also depends on the mpegversion
|
gint spf;
|
||||||
* which we don't pass as a caps field
|
|
||||||
*/
|
|
||||||
|
|
||||||
gst_structure_get_int (structure, "layer", &layer);
|
gst_structure_get_int (structure, "layer", &layer);
|
||||||
|
|
||||||
|
if (!gst_structure_get_int (structure, "mpegaudioversion", &version)) {
|
||||||
|
GST_WARNING_OBJECT (mux,
|
||||||
|
"Unable to determine MPEG audio version, assuming 1");
|
||||||
|
version = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (layer == 1)
|
||||||
|
spf = 384;
|
||||||
|
else if (layer == 2)
|
||||||
|
spf = 1152;
|
||||||
|
else if (version == 2)
|
||||||
|
spf = 576;
|
||||||
|
else
|
||||||
|
spf = 1152;
|
||||||
|
|
||||||
|
context->default_duration =
|
||||||
|
gst_util_uint64_scale (GST_SECOND, spf, audiocontext->samplerate);
|
||||||
|
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case 1:
|
case 1:
|
||||||
context->codec_id = g_strdup (GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L1);
|
context->codec_id = g_strdup (GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L1);
|
||||||
context->default_duration =
|
|
||||||
384 * GST_SECOND / audiocontext->samplerate;
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
context->codec_id = g_strdup (GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L2);
|
context->codec_id = g_strdup (GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L2);
|
||||||
context->default_duration =
|
|
||||||
1152 * GST_SECOND / audiocontext->samplerate;
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
context->codec_id = g_strdup (GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L3);
|
context->codec_id = g_strdup (GST_MATROSKA_CODEC_ID_AUDIO_MPEG1_L3);
|
||||||
context->default_duration =
|
|
||||||
1152 * GST_SECOND / audiocontext->samplerate;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user