diff -rupN gst-plugins-good-0.10.28-org/gst/avi/gstavidemux.c gst-plugins-good-0.10.28/gst/avi/gstavidemux.c
--- gst-plugins-good-0.10.28-org/gst/avi/gstavidemux.c	2011-03-08 19:26:07.000000000 +0530
+++ gst-plugins-good-0.10.28/gst/avi/gstavidemux.c	2013-05-22 15:05:54.942462005 +0530
@@ -553,6 +553,7 @@ gst_avi_demux_handle_src_query (GstPad *
 
       /* take stream duration, fall back to avih duration */
       if ((duration = stream->duration) == -1)
+      if((duration = stream->hdr_duration) == -1)
         duration = avi->duration;
 
       gst_query_parse_duration (query, &fmt, NULL);
