gst-gmyth/nuvdemux/gstnuvdemux.c
branchtrunk
changeset 676 b51559fec601
parent 611 aa1f309ec686
child 692 d9c6cce2b167
     1.1 --- a/gst-gmyth/nuvdemux/gstnuvdemux.c	Tue May 01 17:03:38 2007 +0100
     1.2 +++ b/gst-gmyth/nuvdemux/gstnuvdemux.c	Wed May 16 21:56:47 2007 +0100
     1.3 @@ -610,28 +610,52 @@
     1.4    gboolean res = FALSE;
     1.5    GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (pad));
     1.6  
     1.7 -  switch (GST_QUERY_TYPE (query)) {
     1.8 +
     1.9 +  switch (GST_QUERY_TYPE (query)) 
    1.10 +  {
    1.11      case GST_QUERY_POSITION:
    1.12 -      if (GST_CLOCK_TIME_IS_VALID (nuv->priv->last_frame_time)) {
    1.13 -        gst_query_set_position (query, GST_FORMAT_TIME, nuv->priv->last_frame_time);
    1.14 -        res = TRUE;
    1.15 -      }
    1.16 -      break;
    1.17 +	{
    1.18 +		GstFormat format;
    1.19 +		gst_query_parse_position (query, &format, NULL); 
    1.20 +		switch (format) 
    1.21 +		{
    1.22 +			case GST_FORMAT_TIME:
    1.23 +				if (GST_CLOCK_TIME_IS_VALID (nuv->priv->last_frame_time)) {
    1.24 +			        gst_query_set_position (query, GST_FORMAT_TIME, nuv->priv->last_frame_time);
    1.25 +			        res = TRUE;
    1.26 +				}
    1.27 +			  	break;
    1.28 +			default:				
    1.29 +				break;
    1.30 +		}
    1.31 +		break;
    1.32 +	}		
    1.33      case GST_QUERY_DURATION:
    1.34 -      {
    1.35 -        if (nuv->priv->duration_time != GST_CLOCK_TIME_NONE) {
    1.36 -            gst_query_set_duration (query, GST_FORMAT_TIME, nuv->priv->duration_time);
    1.37 -	    res = TRUE;
    1.38 -        }
    1.39 -      }
    1.40 -      break;
    1.41 -    default:
    1.42 -      res = FALSE;
    1.43 -      break;
    1.44 +	{
    1.45 +	  GstFormat format;		
    1.46 +	  gst_query_parse_duration (query, &format, NULL); 
    1.47 +	  switch (format)
    1.48 +	  {
    1.49 +			case GST_FORMAT_TIME:			 
    1.50 +				if (nuv->priv->duration_time != GST_CLOCK_TIME_NONE) {
    1.51 +			        gst_query_set_duration (query, GST_FORMAT_TIME, nuv->priv->duration_time);
    1.52 +				    res = TRUE;
    1.53 +			    }
    1.54 +				break;
    1.55 +			default:				
    1.56 +			    break;
    1.57 +	  }
    1.58 +	  break;
    1.59 +  	}
    1.60 +	default:
    1.61 +	  break;
    1.62    }
    1.63  
    1.64 +  if (res==FALSE) {
    1.65 +	res = gst_pad_query_default (pad, query);		  
    1.66 +  } 
    1.67 +
    1.68    gst_object_unref (nuv);
    1.69 -
    1.70    return res;
    1.71  }
    1.72