diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c index 6aca82c4d4..f9a1568152 100644 --- a/ext/mpeg2dec/gstmpeg2dec.c +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -32,6 +32,8 @@ */ #ifndef MPEG2_RELEASE typedef picture_t mpeg2_picture_t; +typedef gint mpeg2_state_t; +#define STATE_BUFFER -1 #endif GST_DEBUG_CATEGORY_EXTERN (GST_CAT_SEEK); @@ -418,7 +420,7 @@ update_streaminfo (GstMpeg2dec *mpeg2dec) static void gst_mpeg2dec_flush_decoder (GstMpeg2dec *mpeg2dec) { - gint state; + mpeg2_state_t state; if (mpeg2dec->decoder) { const mpeg2_info_t *info = mpeg2_info (mpeg2dec->decoder); @@ -431,7 +433,7 @@ gst_mpeg2dec_flush_decoder (GstMpeg2dec *mpeg2dec) } } } - while (state != -1); + while (state != STATE_BUFFER); } } @@ -443,7 +445,7 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf) guint8 *data, *end; gint64 pts; const mpeg2_info_t *info; - gint state; + mpeg2_state_t state; gboolean done = FALSE; if (GST_IS_EVENT (buf)) { @@ -656,7 +658,7 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf) break; } /* need more data */ - case -1: + case STATE_BUFFER: done = TRUE; break; /* error */