From 254cf104d87a033adf1c548541f8703904f4a1bc Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 28 Nov 2005 15:47:01 +0000 Subject: [PATCH] ext/mad/gstmad.c: Proper warning statements, Original commit message from CVS: * ext/mad/gstmad.c: (gst_mad_chain): Proper warning statements, Don't error if the src pad isn't linked when pushing. * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_change_state): Proper state_change, avoids borkage when going to READY --- ChangeLog | 8 ++++++++ common | 2 +- ext/mad/gstmad.c | 6 +++--- gst/mpegstream/gstmpegparse.c | 10 +++++++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb1e4bb1a3..253f6b3c4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-11-28 Edward Hervey + + * ext/mad/gstmad.c: (gst_mad_chain): + Proper warning statements, + Don't error if the src pad isn't linked when pushing. + * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_change_state): + Proper state_change, avoids borkage when going to READY + 2005-11-25 Jan Schmidt * ext/mpeg2dec/gstmpeg2dec.c: (handle_sequence): diff --git a/common b/common index c04ad83a0c..b0b08bcd66 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit c04ad83a0c184fcd311de39371570b9e773a60d0 +Subproject commit b0b08bcd66ca385364b6f90663585b09693aec67 diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index cd26f74761..77e92717d3 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -1343,7 +1343,7 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer) * some weird decoding errors... */ GST_LOG ("decoding the header now"); if (mad_header_decode (&mad->frame.header, &mad->stream) == -1) { - GST_DEBUG ("mad_frame_decode had an error: %s", + GST_WARNING ("mad_frame_decode had an error: %s", mad_stream_errorstr (&mad->stream)); } @@ -1365,7 +1365,7 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer) } /* we are in an error state */ mad->in_error = TRUE; - GST_DEBUG ("mad_frame_decode had an error: %s", + GST_WARNING ("mad_frame_decode had an error: %s", mad_stream_errorstr (&mad->stream)); if (!MAD_RECOVERABLE (mad->stream.error)) { GST_ELEMENT_ERROR (mad, STREAM, DECODE, (NULL), (NULL)); @@ -1549,7 +1549,7 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer) } result = gst_pad_push (mad->srcpad, outbuffer); - if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED) { + if (result != GST_FLOW_OK) { /* Head for the exit, dropping samples as we go */ goto_exit = TRUE; } diff --git a/gst/mpegstream/gstmpegparse.c b/gst/mpegstream/gstmpegparse.c index 87f6972a1d..54185643fc 100644 --- a/gst/mpegstream/gstmpegparse.c +++ b/gst/mpegstream/gstmpegparse.c @@ -1114,6 +1114,7 @@ static GstStateChangeReturn gst_mpeg_parse_change_state (GstElement * element, GstStateChange transition) { GstMPEGParse *mpeg_parse = GST_MPEG_PARSE (element); + GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE; switch (transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: @@ -1125,6 +1126,13 @@ gst_mpeg_parse_change_state (GstElement * element, GstStateChange transition) /* initialize parser state */ gst_mpeg_parse_reset (mpeg_parse); break; + default: + break; + } + + result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + + switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: if (mpeg_parse->packetize) { gst_mpeg_packetize_destroy (mpeg_parse->packetize); @@ -1136,7 +1144,7 @@ gst_mpeg_parse_change_state (GstElement * element, GstStateChange transition) break; } - return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + return result; } static void