Get input length from metadata if demuxer failed to retrieve it
authorRafaël Carré <funman@videolan.org>
Mon, 20 Aug 2007 14:45:31 +0000 (14:45 +0000)
committerRafaël Carré <funman@videolan.org>
Mon, 20 Aug 2007 14:45:31 +0000 (14:45 +0000)
src/input/input.c

index fa1ae7d..da21152 100644 (file)
@@ -904,6 +904,12 @@ static int Init( input_thread_t * p_input )
         var_Change( p_input, "length", VLC_VAR_SETVALUE, &val, NULL );
         UpdateItemLength( p_input, val.i_time );
     }
+    else if( p_input->p->input.p_item->i_duration > 0)
+        {
+            val.i_time = p_input->p->input.p_item->i_duration;
+            var_Change( p_input, "length", VLC_VAR_SETVALUE, &val, NULL );
+            UpdateItemLength( p_input, val.i_time );
+        }
 
     /* Start title/chapter */
     if( !p_input->b_preparsing )