summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ext/dts/gstdtsdec.c30
-rw-r--r--gst/real/gstrealaudiodec.c16
3 files changed, 24 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index d5160fb5..cb6aaa5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2007-03-02 Tim-Philipp Müller <tim at centricular dot net>
+ * ext/dts/gstdtsdec.c: (gst_dtsdec_init), (gst_dtsdec_sink_event):
+ A few small clean-ups.
+
+ * gst/real/gstrealaudiodec.c: (gst_real_audio_dec_setcaps):
+ More debug output for failure cases.
+
+2007-03-02 Tim-Philipp Müller <tim at centricular dot net>
+
Patch by: Young-Ho Cha <ganadist at chollian net>
* ext/dts/gstdtsdec.c: (gst_dtsdec_handle_frame),
diff --git a/ext/dts/gstdtsdec.c b/ext/dts/gstdtsdec.c
index 642cdde3..aada01f7 100644
--- a/ext/dts/gstdtsdec.c
+++ b/ext/dts/gstdtsdec.c
@@ -47,15 +47,8 @@ GST_ELEMENT_DETAILS ("DTS audio decoder",
enum
{
- /* FILL ME */
- LAST_SIGNAL
-};
-
-enum
-{
ARG_0,
ARG_DRC
- /* FILL ME */
};
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
@@ -153,18 +146,14 @@ gst_dtsdec_class_init (GstDtsDecClass * klass)
static void
gst_dtsdec_init (GstDtsDec * dtsdec, GstDtsDecClass * g_class)
{
- /* create the sink and src pads */
- dtsdec->sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&sink_factory), "sink");
- gst_pad_set_chain_function (dtsdec->sinkpad, gst_dtsdec_chain);
+ dtsdec->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
+ gst_pad_set_chain_function (dtsdec->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_dtsdec_chain));
gst_pad_set_event_function (dtsdec->sinkpad,
GST_DEBUG_FUNCPTR (gst_dtsdec_sink_event));
gst_element_add_pad (GST_ELEMENT (dtsdec), dtsdec->sinkpad);
- dtsdec->srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get
- (&src_factory), "src");
+ dtsdec->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
gst_pad_use_fixed_caps (dtsdec->srcpad);
gst_element_add_pad (GST_ELEMENT (dtsdec), dtsdec->srcpad);
@@ -308,8 +297,7 @@ gst_dtsdec_sink_event (GstPad * pad, GstEvent * event)
GstDtsDec *dtsdec = GST_DTSDEC (gst_pad_get_parent (pad));
gboolean ret = FALSE;
- GST_LOG ("Handling event of type %d timestamp %llu", GST_EVENT_TYPE (event),
- GST_EVENT_TIMESTAMP (event));
+ GST_LOG_OBJECT (dtsdec, "%s event", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_NEWSEGMENT:{
@@ -331,14 +319,6 @@ gst_dtsdec_sink_event (GstPad * pad, GstEvent * event)
ret = gst_pad_event_default (pad, event);
break;
}
- case GST_EVENT_TAG:
- case GST_EVENT_EOS:{
- ret = gst_pad_event_default (pad, event);
- break;
- }
- case GST_EVENT_FLUSH_START:
- ret = gst_pad_event_default (pad, event);
- break;
case GST_EVENT_FLUSH_STOP:
if (dtsdec->cache) {
gst_buffer_unref (dtsdec->cache);
diff --git a/gst/real/gstrealaudiodec.c b/gst/real/gstrealaudiodec.c
index 9e167578..3dba6512 100644
--- a/gst/real/gstrealaudiodec.c
+++ b/gst/real/gstrealaudiodec.c
@@ -237,8 +237,10 @@ gst_real_audio_dec_setcaps (GstPad * pad, GstCaps * caps)
if (funcs.SetDLLAccessPath)
funcs.SetDLLAccessPath (DEFAULT_PATH);
- if ((res = funcs.RAOpenCodec2 (&context, NULL)))
+ if ((res = funcs.RAOpenCodec2 (&context, NULL))) {
+ GST_DEBUG_OBJECT (dec, "RAOpenCodec2() failed");
goto could_not_initialize;
+ }
data.samplerate = rate;
data.width = width;
@@ -249,15 +251,19 @@ gst_real_audio_dec_setcaps (GstPad * pad, GstCaps * caps)
data.datalen = buf ? GST_BUFFER_SIZE (buf) : 0;
data.data = buf ? GST_BUFFER_DATA (buf) : NULL;
- if ((res = funcs.RAInitDecoder (context, &data)))
+ if ((res = funcs.RAInitDecoder (context, &data))) {
+ GST_DEBUG_OBJECT (dec, "RAInitDecoder() failed");
goto could_not_initialize;
+ }
- if (funcs.RASetPwd)
+ if (funcs.RASetPwd) {
funcs.RASetPwd (dec->context, dec->pwd ? dec->pwd : DEFAULT_PWD);
+ }
- res = funcs.RASetFlavor (context, flavor);
- if (res)
+ if ((res = funcs.RASetFlavor (context, flavor))) {
+ GST_DEBUG_OBJECT (dec, "RASetFlavor(%d) failed", flavor);
goto could_not_initialize;
+ }
caps = gst_caps_new_simple ("audio/x-raw-int",
"endianness", G_TYPE_INT, G_BYTE_ORDER,