>From eb589c418987e7fa7013623a2822d511759da67f Mon Sep 17 00:00:00 2001
From: Bill C Riemers <docbill@hartnell.local>
Date: Mon, 16 Jun 2008 11:30:34 -0400
Subject: [PATCH] Bug fix: Do not report avi's as broken just because the stream is not fast seekable.

---
 modules/demux/avi/avi.c |   40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 64fcf57..c682713 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -660,27 +660,35 @@ aviindex:
                           (mtime_t)p_avih->i_microsecperframe /
                           (mtime_t)1000000 )
     {
-        msg_Warn( p_demux, "broken or missing index, 'seek' will be "
+        if( !p_sys->b_seekable) {
+            if( i_do_index == 0 && ! b_index ) {
+                b_index = true;
+                goto aviindex;
+            }
+        }
+        else {
+            msg_Warn( p_demux, "broken or missing index, 'seek' will be "
                            "axproximative or will have strange behaviour" );
-        if( i_do_index == 0 && !b_index )
-        {
-            int i_create;
-            i_create = intf_UserYesNo( p_demux, _("AVI Index") ,
+            if( i_do_index == 0 && !b_index )
+            {
+                int i_create;
+                i_create = intf_UserYesNo( p_demux, _("AVI Index") ,
                         _( "This AVI file is broken. Seeking will not "
                         "work correctly.\nDo you want to "
                         "try to repair it?\n\nThis might take a long time." ),
                         _( "Repair" ), _( "Don't repair" ), _( "Cancel") );
-            if( i_create == DIALOG_OK_YES )
-            {
-                b_index = true;
-                msg_Dbg( p_demux, "Fixing AVI index" );
-                goto aviindex;
-            }
-            else if( i_create == DIALOG_CANCELLED )
-            {
-                /* Kill input */
-                vlc_object_kill( p_demux->p_parent );
-                goto error;
+                if( i_create == DIALOG_OK_YES )
+                {
+                    b_index = true;
+                    msg_Dbg( p_demux, "Fixing AVI index" );
+                    goto aviindex;
+                }
+                else if( i_create == DIALOG_CANCELLED )
+                {
+                    /* Kill input */
+                    vlc_object_kill( p_demux->p_parent );
+                    goto error;
+                }
             }
         }
     }
-- 
1.5.5.1

