add a unit test for matroskamux fix the bugs that the unit test exposed
Original commit message from CVS: Patch by: Michal Benes <michal.benes@xeris.cz> * check/Makefile.am: * gst/matroska/ebml-write.c: (gst_ebml_write_seek): * gst/matroska/matroska-mux.c: (gst_matroska_mux_handle_src_event), (gst_matroska_mux_audio_pad_setcaps), (gst_matroska_mux_start): add a unit test for matroskamux fix the bugs that the unit test exposed
This commit is contained in:
parent
c63a68efb7
commit
d52d22ca12
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
2005-11-01 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
Patch by: Michal Benes <michal.benes@xeris.cz>
|
||||||
|
|
||||||
|
* check/Makefile.am:
|
||||||
|
* gst/matroska/ebml-write.c: (gst_ebml_write_seek):
|
||||||
|
* gst/matroska/matroska-mux.c: (gst_matroska_mux_handle_src_event),
|
||||||
|
(gst_matroska_mux_audio_pad_setcaps), (gst_matroska_mux_start):
|
||||||
|
add a unit test for matroskamux
|
||||||
|
fix the bugs that the unit test exposed
|
||||||
|
|
||||||
2005-11-01 Tim-Philipp Müller <tim at centricular dot net>
|
2005-11-01 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/autodetect/gstautoaudiosink.c:
|
* gst/autodetect/gstautoaudiosink.c:
|
||||||
|
@ -18,7 +18,9 @@ clean-local: clean-local-check
|
|||||||
TESTS = $(check_PROGRAMS)
|
TESTS = $(check_PROGRAMS)
|
||||||
|
|
||||||
check_PROGRAMS = \
|
check_PROGRAMS = \
|
||||||
elements/level
|
elements/level \
|
||||||
|
elements/matroskamux
|
||||||
|
|
||||||
|
|
||||||
# these tests don't even pass
|
# these tests don't even pass
|
||||||
noinst_PROGRAMS =
|
noinst_PROGRAMS =
|
||||||
|
@ -384,8 +384,7 @@ gst_ebml_write_seek (GstEbmlWrite * ebml, guint64 pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
seek = gst_event_new_newsegment (FALSE, 1.0, GST_FORMAT_BYTES,
|
seek = gst_event_new_newsegment (FALSE, 1.0, GST_FORMAT_BYTES, pos, -1, 0);
|
||||||
pos, -1, GST_CLOCK_TIME_NONE);
|
|
||||||
peer_pad = GST_PAD_PEER (ebml->srcpad);
|
peer_pad = GST_PAD_PEER (ebml->srcpad);
|
||||||
if (peer_pad) {
|
if (peer_pad) {
|
||||||
gst_pad_send_event (peer_pad, seek);
|
gst_pad_send_event (peer_pad, seek);
|
||||||
|
@ -389,11 +389,8 @@ gst_matroska_mux_reset (GstElement * element)
|
|||||||
static gboolean
|
static gboolean
|
||||||
gst_matroska_mux_handle_src_event (GstPad * pad, GstEvent * event)
|
gst_matroska_mux_handle_src_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstMatroskaMux *mux;
|
|
||||||
GstEventType type;
|
GstEventType type;
|
||||||
|
|
||||||
mux = GST_MATROSKA_MUX (gst_pad_get_parent (pad));
|
|
||||||
|
|
||||||
type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
|
type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -607,7 +604,6 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||||||
GstMatroskaTrackContext *context = NULL;
|
GstMatroskaTrackContext *context = NULL;
|
||||||
GstMatroskaTrackAudioContext *audiocontext;
|
GstMatroskaTrackAudioContext *audiocontext;
|
||||||
GstMatroskaPad *collect_pad;
|
GstMatroskaPad *collect_pad;
|
||||||
GstMatroskaMux *mux = GST_MATROSKA_MUX (gst_pad_get_parent (pad));
|
|
||||||
const gchar *mimetype;
|
const gchar *mimetype;
|
||||||
gint samplerate = 0, channels = 0;
|
gint samplerate = 0, channels = 0;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
@ -763,15 +759,14 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
|
|||||||
audiocontext->samplerate = GST_READ_UINT32_LE (hdr + 1);
|
audiocontext->samplerate = GST_READ_UINT32_LE (hdr + 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING_OBJECT (mux, "Vorbis header does not contain "
|
GST_WARNING ("Vorbis header does not contain "
|
||||||
"three buffers (found %d buffers), Ignoring.", bufarr->len);
|
"three buffers (found %d buffers), Ignoring.", bufarr->len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv_data == NULL) {
|
if (priv_data == NULL) {
|
||||||
GST_WARNING_OBJECT (mux,
|
GST_WARNING ("Could not write Vorbis header into codec private data. "
|
||||||
"Could not write Vorbis header into codec private data. "
|
|
||||||
"You will probably not be able to play the stream.");
|
"You will probably not be able to play the stream.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1085,7 +1080,8 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
|
|||||||
collect_pad = (GstMatroskaPad *) collected->data;
|
collect_pad = (GstMatroskaPad *) collected->data;
|
||||||
thepad = collect_pad->collect.pad;
|
thepad = collect_pad->collect.pad;
|
||||||
|
|
||||||
if (GST_PAD_IS_USABLE (thepad)) {
|
if (GST_PAD_IS_USABLE (thepad)
|
||||||
|
&& collect_pad->track->codec_id != 0) {
|
||||||
collect_pad->track->num = tracknum++;
|
collect_pad->track->num = tracknum++;
|
||||||
child = gst_ebml_write_master_start (ebml, GST_MATROSKA_ID_TRACKENTRY);
|
child = gst_ebml_write_master_start (ebml, GST_MATROSKA_ID_TRACKENTRY);
|
||||||
gst_matroska_mux_track_header (mux, collect_pad->track);
|
gst_matroska_mux_track_header (mux, collect_pad->track);
|
||||||
|
@ -18,7 +18,9 @@ clean-local: clean-local-check
|
|||||||
TESTS = $(check_PROGRAMS)
|
TESTS = $(check_PROGRAMS)
|
||||||
|
|
||||||
check_PROGRAMS = \
|
check_PROGRAMS = \
|
||||||
elements/level
|
elements/level \
|
||||||
|
elements/matroskamux
|
||||||
|
|
||||||
|
|
||||||
# these tests don't even pass
|
# these tests don't even pass
|
||||||
noinst_PROGRAMS =
|
noinst_PROGRAMS =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user