Ticket #1532: vlc-0.8.6g.diff

File vlc-0.8.6g.diff, 1.9 kB (added by docbill, 6 months ago)

Patch to fix this bug in the 0.8.6g version of vlc.

  • vlc-0.8.6g/modules/access/http.c

    old new  
    680680    msg_Dbg( p_access, "trying to seek to "I64Fd, i_pos ); 
    681681 
    682682    Disconnect( p_access ); 
     683    if( p_access->info.i_pos < 0 ) 
     684    { 
     685        msg_Err( p_access, "seeking too early" ); 
     686        return Seek( p_access, 0); 
     687    } 
     688    else 
     689    { 
     690        int64_t i_size = p_access->info.i_size; 
     691        if(i_size > 0) 
     692        { 
     693            if( i_size < i_pos ) 
     694            { 
     695                msg_Err( p_access, "seeking too far" ); 
     696                // Fix me: This replicates the file.c behavior of returning 
     697                // success even when seeking too far. 
     698                return Seek( p_access, i_size ); 
     699            } 
     700            else if ( i_size == i_pos ) 
     701            { 
     702                // This is the only way I have found to seek to the end, and 
     703                // still leave the file handle open. 
     704                int retval = Seek( p_access, i_pos - 1); 
     705                if ( retval == VLC_SUCCESS ) { 
     706                  int8_t p_buffer[2]; 
     707                  Read( p_access, p_buffer, 1 ); 
     708                  // Reset EOF 
     709                  p_access->info.b_eof = VLC_FALSE; 
     710                } 
     711                return retval; 
     712            } 
     713        } 
     714    } 
    683715 
     716    p_access->info.i_pos = i_pos; 
    684717    if( Connect( p_access, i_pos ) ) 
    685718    { 
    686719        msg_Err( p_access, "seek failed" ); 
     
    710743            break; 
    711744        case ACCESS_CAN_FASTSEEK: 
    712745            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* ); 
    713             *pb_bool = VLC_FALSE; 
     746            // http 1.1 should be just as fast as nfs... 
     747            *pb_bool = p_sys->b_seekable; 
    714748            break; 
    715749        case ACCESS_CAN_PAUSE: 
    716750        case ACCESS_CAN_CONTROL_PACE: