gst/flv/gstflvmux.c: Don't set video_codec to the value that actually should go into audio codec, otherwise we create...

Original commit message from CVS:
* gst/flv/gstflvmux.c: (gst_flv_mux_audio_pad_setcaps),
(gst_flv_mux_write_buffer):
Don't set video_codec to the value that actually should go
into audio codec, otherwise we create invalid files.
Fixes bug #556564.
This commit is contained in:
Sebastian Dröge 2008-10-16 15:21:15 +00:00
parent e3cf903b81
commit 5453883e63
2 changed files with 12 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2008-10-16 Sebastian Dröge <slomo@circular-chaos.org>
* gst/flv/gstflvmux.c: (gst_flv_mux_audio_pad_setcaps),
(gst_flv_mux_write_buffer):
Don't set video_codec to the value that actually should go
into audio codec, otherwise we create invalid files.
Fixes bug #556564.
2008-10-16 Jan Schmidt <jan.schmidt@sun.com> 2008-10-16 Jan Schmidt <jan.schmidt@sun.com>
* tests/check/Makefile.am: * tests/check/Makefile.am:

View file

@ -310,9 +310,9 @@ gst_flv_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
else else
ret = FALSE; ret = FALSE;
} else if (strcmp (gst_structure_get_name (s), "audio/x-alaw") == 0) { } else if (strcmp (gst_structure_get_name (s), "audio/x-alaw") == 0) {
cpad->video_codec = 7; cpad->audio_codec = 7;
} else if (strcmp (gst_structure_get_name (s), "audio/x-mulaw") == 0) { } else if (strcmp (gst_structure_get_name (s), "audio/x-mulaw") == 0) {
cpad->video_codec = 8; cpad->audio_codec = 8;
} else { } else {
ret = FALSE; ret = FALSE;
} }
@ -536,7 +536,7 @@ next:
size += GST_BUFFER_SIZE (buffer); size += GST_BUFFER_SIZE (buffer);
} else { } else {
size += 1; size += 1;
if (cpad->video_codec == 10 && !cpad->sent_codec_data) if (cpad->audio_codec == 10 && !cpad->sent_codec_data)
size += 1 + GST_BUFFER_SIZE (cpad->audio_codec_data); size += 1 + GST_BUFFER_SIZE (cpad->audio_codec_data);
else if (cpad->audio_codec == 10) else if (cpad->audio_codec == 10)
size += 1 + GST_BUFFER_SIZE (buffer); size += 1 + GST_BUFFER_SIZE (buffer);
@ -595,7 +595,7 @@ next:
data[11] |= (cpad->width << 1) & 0x02; data[11] |= (cpad->width << 1) & 0x02;
data[11] |= (cpad->channels << 0) & 0x01; data[11] |= (cpad->channels << 0) & 0x01;
if (cpad->video_codec == 10 && !cpad->sent_codec_data) { if (cpad->audio_codec == 10 && !cpad->sent_codec_data) {
data[12] = 0; data[12] = 0;
memcpy (data + 11 + 1 + 1, GST_BUFFER_DATA (cpad->audio_codec_data), memcpy (data + 11 + 1 + 1, GST_BUFFER_DATA (cpad->audio_codec_data),