Commit 3bfdca14 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: remove write-only input_title_t.i_size

parent 5e348a53
...@@ -89,7 +89,6 @@ typedef struct input_title_t ...@@ -89,7 +89,6 @@ typedef struct input_title_t
bool b_menu; /* Is it a menu or a normal entry */ bool b_menu; /* Is it a menu or a normal entry */
int64_t i_length; /* Length(microsecond) if known, else 0 */ int64_t i_length; /* Length(microsecond) if known, else 0 */
int64_t i_size; /* Size (bytes) if known, else 0 */
/* Title seekpoint */ /* Title seekpoint */
int i_seekpoint; int i_seekpoint;
...@@ -105,7 +104,6 @@ static inline input_title_t *vlc_input_title_New(void) ...@@ -105,7 +104,6 @@ static inline input_title_t *vlc_input_title_New(void)
t->psz_name = NULL; t->psz_name = NULL;
t->b_menu = false; t->b_menu = false;
t->i_length = 0; t->i_length = 0;
t->i_size = 0;
t->i_seekpoint = 0; t->i_seekpoint = 0;
t->seekpoint = NULL; t->seekpoint = NULL;
...@@ -136,7 +134,6 @@ static inline input_title_t *vlc_input_title_Duplicate( const input_title_t *t ) ...@@ -136,7 +134,6 @@ static inline input_title_t *vlc_input_title_Duplicate( const input_title_t *t )
if( t->psz_name ) dup->psz_name = strdup( t->psz_name ); if( t->psz_name ) dup->psz_name = strdup( t->psz_name );
dup->b_menu = t->b_menu; dup->b_menu = t->b_menu;
dup->i_length = t->i_length; dup->i_length = t->i_length;
dup->i_size = t->i_size;
dup->i_seekpoint = t->i_seekpoint; dup->i_seekpoint = t->i_seekpoint;
if( t->i_seekpoint > 0 ) if( t->i_seekpoint > 0 )
{ {
......
...@@ -161,16 +161,12 @@ static int Open( vlc_object_t *p_this ) ...@@ -161,16 +161,12 @@ static int Open( vlc_object_t *p_this )
/* The first title isn't usable */ /* The first title isn't usable */
p_sys->i_titles--; p_sys->i_titles--;
/* Build title table */
for( int i = 0; i < p_sys->i_titles; i++ ) for( int i = 0; i < p_sys->i_titles; i++ )
{ {
input_title_t *t = p_sys->title[i] = vlc_input_title_New(); p_sys->title[i] = vlc_input_title_New();
msg_Dbg( p_access, "title[%d] start=%d", i, p_sys->p_sectors[1+i] ); msg_Dbg( p_access, "title[%d] start=%d", i, p_sys->p_sectors[1+i] );
msg_Dbg( p_access, "title[%d] end=%d", i, p_sys->p_sectors[i+2] ); msg_Dbg( p_access, "title[%d] end=%d", i, p_sys->p_sectors[i+2] );
t->i_size = ( p_sys->p_sectors[i+2] - p_sys->p_sectors[i+1] ) *
(int64_t)VCD_DATA_SIZE;
} }
/* Map entry points into chapters */ /* Map entry points into chapters */
......
...@@ -377,7 +377,6 @@ VCDSegments( access_t * p_access ) ...@@ -377,7 +377,6 @@ VCDSegments( access_t * p_access )
t = p_vcdplayer->p_title[p_vcdplayer->i_titles] = vlc_input_title_New(); t = p_vcdplayer->p_title[p_vcdplayer->i_titles] = vlc_input_title_New();
p_vcdplayer->i_titles++; p_vcdplayer->i_titles++;
t->i_size = 0; /* Not sure Segments have a size associated */
t->psz_name = strdup(_("Segments")); t->psz_name = strdup(_("Segments"));
/* We have one additional segment allocated so we can get the size /* We have one additional segment allocated so we can get the size
...@@ -441,12 +440,7 @@ VCDTitles( access_t * p_access ) ...@@ -441,12 +440,7 @@ VCDTitles( access_t * p_access )
char psz_track[80]; char psz_track[80];
snprintf( psz_track, sizeof(psz_track), "%s %02d", _("Track"), i ); snprintf( psz_track, sizeof(psz_track), "%s %02d", _("Track"), i );
t->i_size = (int64_t) vcdinfo_get_track_size( p_vcdplayer->vcd,
i ) * M2F2_SECTOR_SIZE / CDIO_CD_FRAMESIZE ;
t->psz_name = strdup(psz_track); t->psz_name = strdup(psz_track);
dbg_print( INPUT_DBG_MRL, "track[%d] i_size: %"PRIi64, i, t->i_size );
p_vcdplayer->i_titles++; p_vcdplayer->i_titles++;
} }
...@@ -462,7 +456,7 @@ VCDLIDs( access_t * p_access ) ...@@ -462,7 +456,7 @@ VCDLIDs( access_t * p_access )
{ {
vcdplayer_t *p_vcdplayer = (vcdplayer_t *) p_access->p_sys; vcdplayer_t *p_vcdplayer = (vcdplayer_t *) p_access->p_sys;
input_title_t *t; input_title_t *t;
unsigned int i_lid, i_title; unsigned int i_lid;
p_vcdplayer->i_lids = vcdinfo_get_num_LIDs(p_vcdplayer->vcd); p_vcdplayer->i_lids = vcdinfo_get_num_LIDs(p_vcdplayer->vcd);
p_vcdplayer->i_lid = VCDINFO_INVALID_ENTRY; p_vcdplayer->i_lid = VCDINFO_INVALID_ENTRY;
...@@ -493,7 +487,6 @@ VCDLIDs( access_t * p_access ) ...@@ -493,7 +487,6 @@ VCDLIDs( access_t * p_access )
t->b_menu = true; t->b_menu = true;
t->psz_name = strdup( "LIDs" ); t->psz_name = strdup( "LIDs" );
i_title = p_vcdplayer->i_tracks;
for( i_lid = 1 ; i_lid <= p_vcdplayer->i_lids ; i_lid++ ) for( i_lid = 1 ; i_lid <= p_vcdplayer->i_lids ; i_lid++ )
{ {
char psz_lid[100]; char psz_lid[100];
...@@ -658,13 +651,6 @@ VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track, ...@@ -658,13 +651,6 @@ VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track,
VCDUpdateVar( p_access, p_itemid->num, VLC_VAR_SETVALUE, VCDUpdateVar( p_access, p_itemid->num, VLC_VAR_SETVALUE,
"chapter", _("Entry"), "Setting entry/segment"); "chapter", _("Entry"), "Setting entry/segment");
p_vcdplayer->i_cur_title = i_track - 1; p_vcdplayer->i_cur_title = i_track - 1;
if (p_vcdplayer->b_track_length)
p_vcdplayer->size = p_vcdplayer->p_title[i_track-1]->i_size;
else
p_vcdplayer->size = M2F2_SECTOR_SIZE * (int64_t)
vcdinfo_get_entry_sect_count(p_vcdplayer->vcd,p_itemid->num);
dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC), "size: %"PRIu64,
p_vcdplayer->size );
p_vcdplayer->i_cur_chapter = p_itemid->num; p_vcdplayer->i_cur_chapter = p_itemid->num;
break; break;
...@@ -676,14 +662,12 @@ VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track, ...@@ -676,14 +662,12 @@ VCDSetOrigin( access_t *p_access, lsn_t i_lsn, track_t i_track,
the entry seekpoints and (zeroed) lid seekpoints. the entry seekpoints and (zeroed) lid seekpoints.
*/ */
p_vcdplayer->i_cur_title = p_vcdplayer->i_titles - 1; p_vcdplayer->i_cur_title = p_vcdplayer->i_titles - 1;
p_vcdplayer->size = 0; /* No seeking on stills, please. */
p_vcdplayer->i_cur_chapter = p_vcdplayer->i_entries p_vcdplayer->i_cur_chapter = p_vcdplayer->i_entries
+ p_vcdplayer->i_lids + p_itemid->num; + p_vcdplayer->i_lids + p_itemid->num;
break; break;
case VCDINFO_ITEM_TYPE_TRACK: case VCDINFO_ITEM_TYPE_TRACK:
p_vcdplayer->i_cur_title = i_track - 1; p_vcdplayer->i_cur_title = i_track - 1;
p_vcdplayer->size = p_vcdplayer->p_title[i_track - 1]->i_size;
p_vcdplayer->i_cur_chapter = vcdinfo_track_get_entry(p_vcdplayer->vcd, p_vcdplayer->i_cur_chapter = vcdinfo_track_get_entry(p_vcdplayer->vcd,
i_track); i_track);
break; break;
...@@ -837,7 +821,6 @@ VCDOpen ( vlc_object_t *p_this ) ...@@ -837,7 +821,6 @@ VCDOpen ( vlc_object_t *p_this )
p_vcdplayer->i_debug = var_InheritInteger( p_this, MODULE_STRING "-debug" ); p_vcdplayer->i_debug = var_InheritInteger( p_this, MODULE_STRING "-debug" );
p_access->p_sys = (access_sys_t *) p_vcdplayer; p_access->p_sys = (access_sys_t *) p_vcdplayer;
p_vcdplayer->size = 0;
/* Set where to log errors messages from libcdio. */ /* Set where to log errors messages from libcdio. */
p_vcd_access = p_access; p_vcd_access = p_access;
...@@ -858,8 +841,6 @@ VCDOpen ( vlc_object_t *p_this ) ...@@ -858,8 +841,6 @@ VCDOpen ( vlc_object_t *p_this )
p_vcdplayer->psz_source = strdup(psz_source); p_vcdplayer->psz_source = strdup(psz_source);
p_vcdplayer->i_blocks_per_read = var_InheritInteger( p_this, MODULE_STRING p_vcdplayer->i_blocks_per_read = var_InheritInteger( p_this, MODULE_STRING
"-blocks-per-read" ); "-blocks-per-read" );
p_vcdplayer->b_track_length = var_InheritInteger( p_this, MODULE_STRING
"-track-length" );
p_vcdplayer->in_still = false; p_vcdplayer->in_still = false;
p_vcdplayer->play_item.type = VCDINFO_ITEM_TYPE_NOTFOUND; p_vcdplayer->play_item.type = VCDINFO_ITEM_TYPE_NOTFOUND;
p_vcdplayer->p_input = p_access->p_input; p_vcdplayer->p_input = p_access->p_input;
......
...@@ -107,11 +107,7 @@ vlc_module_begin () ...@@ -107,11 +107,7 @@ vlc_module_begin ()
"Otherwise we play by tracks."), "Otherwise we play by tracks."),
false ) false )
add_bool( MODULE_STRING "-track-length", true, add_obsolete_bool( MODULE_STRING "-track-length" )
N_("Use track length as maximum unit in seek?"),
N_("If set, the length of the seek bar is the track rather than "
"the length of an entry."),
false )
add_bool( MODULE_STRING "-extended-info", false, add_bool( MODULE_STRING "-extended-info", false,
N_("Show extended VCD info?"), N_("Show extended VCD info?"),
......
...@@ -159,10 +159,8 @@ typedef struct vcdplayer_input_s ...@@ -159,10 +159,8 @@ typedef struct vcdplayer_input_s
int i_audio_nb; int i_audio_nb;
int i_still; int i_still;
bool b_end_of_cell; bool b_end_of_cell;
bool b_track_length; /* Use track as max unit in seek */
input_thread_t *p_input; input_thread_t *p_input;
access_t *p_access; access_t *p_access;
uint64_t size;
} vcdplayer_t; } vcdplayer_t;
......
...@@ -818,7 +818,6 @@ static void ImportMarks( access_t *p_access ) ...@@ -818,7 +818,6 @@ static void ImportMarks( access_t *p_access )
} }
p_marks->psz_name = strdup( _("VDR Cut Marks") ); p_marks->psz_name = strdup( _("VDR Cut Marks") );
p_marks->i_length = i_frame_count * (int64_t)( CLOCK_FREQ / p_sys->fps ); p_marks->i_length = i_frame_count * (int64_t)( CLOCK_FREQ / p_sys->fps );
p_marks->i_size = p_sys->size;
/* offset for chapter positions */ /* offset for chapter positions */
int i_chapter_offset = p_sys->fps / 1000 * int i_chapter_offset = p_sys->fps / 1000 *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment