Changeset 6ba6c14fd5e810734e4170bbb95b1a731525212c

Show
Ignore:
Timestamp:
20/12/04 05:52:29 (4 years ago)
Author:
Rocky Bernstein <rocky@videolan.org>
git-committer:
Rocky Bernstein <rocky@videolan.org> 1103518349 +0000
git-parent:

[cf38ae4672f190d66fac78709f6019b1cb484cad]

git-author:
Rocky Bernstein <rocky@videolan.org> 1103518349 +0000
Message:

Fix bad bug with was causing discontinuous video playback.
Some entry navigation improved.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/vcdx/access.c

    rcf38ae4 r6ba6c14  
    3535 
    3636#include "vcd.h" 
    37 #include "vcdplayer.h" 
     37#include "info.h" 
    3838#include "intf.h" 
    39 #include "info.h" 
    4039#include "vlc_keys.h" 
    4140 
     
    224223      if ( VCDReadSector( VLC_OBJECT(p_access), p_vcd->vcd, 
    225224                          p_vcd->i_lsn, 
    226                           (byte_t *) p_block->p_buffer + (i_index*M2F2_SECTOR_SIZE) ) < 0 ) 
    227         { 
     225                          (byte_t *) p_block->p_buffer  
     226              + (i_index*M2F2_SECTOR_SIZE) ) < 0 ) 
     227      { 
    228228          LOG_ERR ("could not read sector %lu",  
    229229           (long unsigned int) p_vcd->i_lsn ); 
     230        /* Try to skip one sector (in case of bad sectors) */ 
     231      p_vcd->i_lsn ++; 
     232      p_access->info.i_pos += M2F2_SECTOR_SIZE; 
    230233          return NULL; 
     234      } 
     235 
     236      p_vcd->i_lsn ++; 
     237      p_access->info.i_pos += M2F2_SECTOR_SIZE; 
     238 
     239      /* Update seekpoint */ 
     240      if ( VCDINFO_ITEM_TYPE_ENTRY == p_vcd->play_item.type ) 
     241      { 
     242        const input_title_t *t = p_vcd->p_title[p_access->info.i_title]; 
     243     
     244        if( t->i_seekpoint > 0 && 
     245            p_access->info.i_seekpoint + 1 < t->i_seekpoint && 
     246            p_access->info.i_pos + i_read * M2F2_SECTOR_SIZE >= 
     247            t->seekpoint[p_access->info.i_seekpoint+1]->i_byte_offset ) 
     248        { 
     249        const track_t i_track = p_vcd->i_track; 
     250        const unsigned int i_entry = ++p_vcd->play_item.num; 
     251            msg_Dbg( p_access, "seekpoint change" ); 
     252        VCDSetOrigin( p_access,  
     253              vcdinfo_get_track_lsn(p_vcd->vcd, i_track), 
     254              vcdinfo_get_entry_lsn(p_vcd->vcd, i_entry), 
     255              vcdinfo_get_track_lsn(p_vcd->vcd, i_track+1), 
     256              i_track, &(p_vcd->play_item) ); 
    231257        } 
    232  
    233       p_vcd->i_lsn ++; 
    234  
     258      } 
    235259    } 
    236260 
     
    244268        } 
    245269     
     270    p_vcd->i_lsn ++; 
    246271    return NULL; 
    247272    } 
    248  
    249     /* Update seekpoints */ 
    250     for( i_read = 0; i_read < i_blocks; i_read++ ) 
    251     { 
    252         input_title_t *t = p_vcd->p_title[p_access->info.i_title]; 
    253  
    254         if( t->i_seekpoint > 0 && 
    255             p_access->info.i_seekpoint + 1 < t->i_seekpoint && 
    256             p_access->info.i_pos + i_read * M2F2_SECTOR_SIZE >= 
    257             t->seekpoint[p_access->info.i_seekpoint+1]->i_byte_offset ) 
    258         { 
    259             msg_Dbg( p_access, "seekpoint change" ); 
    260             p_access->info.i_update |= INPUT_UPDATE_SEEKPOINT; 
    261             p_access->info.i_seekpoint++; 
    262         } 
    263     } 
    264  
    265     /* Update a few values */ 
    266     p_vcd->i_lsn += i_blocks; 
    267     p_access->info.i_pos += p_block->i_buffer; 
    268273 
    269274    return p_block; 
     
    845850  p_access->info.i_size      = p_vcd->p_title[i_title]->i_size; 
    846851  p_access->info.i_pos       = ( i_lsn - origin_lsn ) * M2F2_SECTOR_SIZE; 
    847   p_access->info.i_update   |= INPUT_UPDATE_TITLE|INPUT_UPDATE_SIZE; 
     852  p_access->info.i_update   |= INPUT_UPDATE_TITLE|INPUT_UPDATE_SIZE 
     853                            |  INPUT_UPDATE_SEEKPOINT; 
    848854 
    849855  dbg_print( (INPUT_DBG_CALL|INPUT_DBG_LSN), 
     
    853859         (long unsigned int) end_lsn, i_track ); 
    854860 
    855   VCDUpdateVar( p_access, p_itemid->num, VLC_VAR_SETVALUE, 
    856                 "chapter",  
    857         p_itemid->type == VCDINFO_ITEM_TYPE_ENTRY ? 
    858         _("Entry") : _("Segment"),  
    859         "Setting entry/segment"); 
     861  if (p_itemid->type == VCDINFO_ITEM_TYPE_ENTRY) { 
     862    VCDUpdateVar( p_access, p_itemid->num, VLC_VAR_SETVALUE, 
     863          "chapter", _("Entry"), "Setting entry/segment"); 
     864    p_access->info.i_seekpoint = p_itemid->num; 
     865  } else { 
     866    VCDUpdateVar( p_access, p_itemid->num, VLC_VAR_SETVALUE, 
     867          "chapter", _("Segment"),  "Setting entry/segment"); 
     868    /* seekpoint is what? ??? */  
     869  } 
     870   
     871  {  
     872    unsigned int psz_mrl_max = strlen(VCD_MRL_PREFIX)  
     873      + strlen(p_vcd->psz_source) + sizeof("@E999")+3; 
     874    char *psz_mrl = malloc( psz_mrl_max ); 
     875 
     876    if( psz_mrl )  
     877    { 
     878        char *psz_name; 
     879    snprintf(psz_mrl, psz_mrl_max, "%s%s",  
     880         VCD_MRL_PREFIX, p_vcd->psz_source); 
     881    psz_name = VCDFormatStr( p_access, p_vcd, 
     882                 config_GetPsz( p_access, MODULE_STRING  
     883                        "-title-format" ), 
     884                psz_mrl, &(p_vcd->play_item) ); 
     885    input_Control( p_vcd->p_input, INPUT_SET_NAME, psz_name ); 
     886    free(psz_mrl); 
     887    } 
     888  } 
     889 
    860890} 
    861891 
     
    10611091    } 
    10621092 
    1063 #if 1 
    10641093    b_play_ok = (VLC_SUCCESS == VCDPlay( p_access, itemid )); 
    10651094 
     
    10681097      goto err_exit; 
    10691098    } 
    1070 #else  
    1071     /* We assume playing CD track 2 (1st MPEG data) for now  */ 
    1072        
    1073     p_vcd->origin_lsn = p_vcd->i_lsn = p_vcd->p_sectors[1]; 
    1074     p_access->info.i_title = 0; 
    1075     p_access->info.i_seekpoint = 0; 
    1076     p_access->info.i_size = p_vcd->p_title[0]->i_size; 
    1077     p_access->info.i_pos = 0; 
    1078      
    1079 #endif 
    10801099 
    10811100    p_access->psz_demux = strdup( "ps" ); 
     
    12801299            input_title_t *t = p_vcd->p_title[p_access->info.i_title]; 
    12811300            i = (int)va_arg( args, int ); 
     1301 
     1302        dbg_print( INPUT_DBG_EVENT, "set seekpoint" ); 
    12821303            if( t->i_seekpoint > 0 ) 
    12831304            { 
     
    13011322 
    13021323        case ACCESS_SET_PRIVATE_ID_STATE: 
    1303         dbg_print( INPUT_DBG_EVENT, "set seekpoint/set private id" ); 
     1324        dbg_print( INPUT_DBG_EVENT, "set private id" ); 
    13041325            return VLC_EGENERIC; 
    13051326 
  • modules/access/vcdx/info.c

    rcf38ae4 r6ba6c14  
    2727#include "vcd.h" 
    2828#include <vlc_playlist.h>  
    29 #include "vcdplayer.h" 
    3029#include "vlc_keys.h" 
     30#include "info.h" 
    3131 
    3232#include <cdio/cdio.h> 
     
    3636#include <libvcd/info.h> 
    3737#include <libvcd/logging.h> 
    38  
    39 static char *VCDFormatStr(const access_t *p_access, access_vcd_data_t *p_vcd, 
    40               const char format_str[], const char *mrl, 
    41               const vcdinfo_itemid_t *itemid); 
    4238 
    4339static inline void 
  • modules/access/vcdx/info.h

    rcf38ae4 r6ba6c14  
    2222 *****************************************************************************/ 
    2323 
     24#ifndef VCD_INFO_H 
     25#define VCD_INFO_H 
     26 
     27#include "vcdplayer.h" 
     28 
    2429/* 
    2530 Fills out playlist information. 
     
    3843            const char format_str[], const char *mrl, 
    3944            const vcdinfo_itemid_t *itemid); 
     45 
     46#endif /* VCD_INFO_H */