--- /home/silentm/Development/GStreamer/gst-plugins-good/gst/rtp/gstrtpjpegpay.c	2011-08-22 09:46:07.532045208 -0400
+++ /home/silentm/Development/GStreamer/gst-plugins-good-patched/gst/rtp/gstrtpjpegpay.c	2011-08-22 09:44:19.790214063 -0400
@@ -618,7 +618,7 @@
   guint jpeg_header_size = 0;
   guint offset;
   gboolean frame_done;
-  gboolean sos_found, sof_found, dqt_found, dri_found;
+  gboolean sos_found, sof_found, dqt_found, dri_found, eoi_found;
   gint i;
   GstBufferList *list = NULL;
   GstBufferListIterator *it = NULL;
@@ -639,8 +639,9 @@
   dqt_found = FALSE;
   sof_found = FALSE;
   dri_found = FALSE;
+  eoi_found = FALSE;
 
-  while (!sos_found && (offset < size)) {
+  while (!sos_found && !eoi_found && (offset < size)) {
     GST_LOG_OBJECT (pay, "checking from offset %u", offset);
     switch (gst_rtp_jpeg_pay_scan_marker (data, size, &offset)) {
       case JPEG_MARKER_JFIF:
@@ -666,7 +667,10 @@
         jpeg_header_size = offset + gst_rtp_jpeg_pay_header_size (data, offset);
         break;
       case JPEG_MARKER_EOI:
-        GST_WARNING_OBJECT (pay, "EOI reached before SOS!");
+        //GST_WARNING_OBJECT (pay, "EOI reached before SOS!");
+        eoi_found = TRUE;
+        GST_LOG_OBJECT (pay, "EOI found");
+        jpeg_header_size = offset + gst_rtp_jpeg_pay_header_size (data, offset);
         break;
       case JPEG_MARKER_SOI:
         GST_LOG_OBJECT (pay, "SOI found");
