1
mirror of https://github.com/mpv-player/mpv synced 2024-11-03 03:19:24 +01:00

options, avi: remove -loadidx/-saveidx

This was probably useless even many years ago.
This commit is contained in:
wm4 2012-10-28 20:13:17 +01:00
parent a04ad728c5
commit 042901940f
5 changed files with 0 additions and 78 deletions

View File

@ -1146,15 +1146,6 @@
--list-properties
Print a list of the available properties.
--loadidx=<filename>
The file from which to read the video index data saved by ``--saveidx``.
This index will be used for seeking, overriding any index data contained
in the AVI itself. mpv will not prevent you from loading an index file
generated from a different AVI, but this is sure to cause unfavorable
results.
*NOTE*: This option is obsolete now that mpv has OpenDML support.
--loop=<number|inf|no>
Loops playback <number> times. ``inf`` means forever and ``no`` disables
looping.
@ -1616,12 +1607,6 @@
grayscale output with this option. Not supported by all video output
drivers.
--saveidx=<filename>
Force index rebuilding and dump the index to <filename>. Currently this
only works with AVI files.
*NOTE*: This option is obsolete now that mpv has OpenDML support.
--sb=<n>
Seek to byte position. Useful for playback from CD-ROM images or VOB files
with junk at the beginning. See also ``--ss``.

View File

@ -390,8 +390,6 @@ const m_option_t common_opts[] = {
// AVI and Ogg only: (re)build index at startup
{"idx", &index_mode, CONF_TYPE_FLAG, 0, -1, 1, NULL},
{"forceidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 2, NULL},
{"saveidx", &index_file_save, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"loadidx", &index_file_load, CONF_TYPE_STRING, 0, 0, 0, NULL},
// select audio/video/subtitle stream
OPT_TRACKCHOICE("aid", audio_id),

View File

@ -74,9 +74,6 @@ while(1){
char* hdr=NULL;
//
if(stream_eof(demuxer->stream)) break;
// Imply -forceidx if -saveidx is specified
if (index_file_save)
index_mode = 2;
//
if(id==mmioFOURCC('L','I','S','T')){
unsigned len=stream_read_dword_le(demuxer->stream); // list size
@ -587,44 +584,6 @@ freeout:
}
/* Read a saved index file */
if (index_file_load) {
FILE *fp;
char magic[7];
unsigned int i;
if ((fp = fopen(index_file_load, "r")) == NULL) {
mp_tmsg(MSGT_HEADER,MSGL_ERR, "Can't read index file %s: %s\n", index_file_load, strerror(errno));
goto gen_index;
}
fread(&magic, 6, 1, fp);
if (strncmp(magic, "MPIDX1", 6)) {
mp_tmsg(MSGT_HEADER,MSGL_ERR, "%s is not a valid MPlayer index file.\n", index_file_load);
goto gen_index;
}
fread(&priv->idx_size, sizeof(priv->idx_size), 1, fp);
priv->idx=malloc(priv->idx_size*sizeof(AVIINDEXENTRY));
if (!priv->idx) {
mp_tmsg(MSGT_HEADER,MSGL_ERR, "Could not allocate memory for index data from %s.\n", index_file_load);
priv->idx_size = 0;
goto gen_index;
}
for (i=0; i<priv->idx_size;i++) {
AVIINDEXENTRY *idx;
idx=&((AVIINDEXENTRY *)priv->idx)[i];
fread(idx, sizeof(AVIINDEXENTRY), 1, fp);
if (feof(fp)) {
mp_tmsg(MSGT_HEADER,MSGL_ERR, "premature end of index file %s\n", index_file_load);
free(priv->idx);
priv->idx_size = 0;
goto gen_index;
}
}
fclose(fp);
mp_tmsg(MSGT_HEADER,MSGL_INFO, "Loaded index file: %s\n", index_file_load);
}
gen_index:
if(index_mode>=2 || (priv->idx_size==0 && index_mode==1)){
int idx_pos = 0;
// build index for file:
@ -711,23 +670,5 @@ skip_chunk:
mp_tmsg(MSGT_HEADER,MSGL_INFO,"AVI: Generated index table for %d chunks!\n",priv->idx_size);
if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size,MSGL_DBG2);
/* Write generated index to a file */
if (index_file_save) {
FILE *fp;
unsigned int i;
if ((fp=fopen(index_file_save, "w")) == NULL) {
mp_tmsg(MSGT_HEADER,MSGL_ERR, "Couldn't write index file %s: %s\n", index_file_save, strerror(errno));
return;
}
fwrite("MPIDX1", 6, 1, fp);
fwrite(&priv->idx_size, sizeof(priv->idx_size), 1, fp);
for (i=0; i<priv->idx_size; i++) {
AVIINDEXENTRY *idx = &((AVIINDEXENTRY *)priv->idx)[i];
fwrite(idx, sizeof(AVIINDEXENTRY), 1, fp);
}
fclose(fp);
mp_tmsg(MSGT_HEADER,MSGL_INFO, "Saved index file: %s\n", index_file_save);
}
}
}

View File

@ -432,7 +432,6 @@ do{
// AVI demuxer parameters:
int index_mode=-1; // -1=untouched 0=don't use index 1=use (generate) index
char *index_file_save = NULL, *index_file_load = NULL;
int force_ni=0; // force non-interleaved AVI parsing
static demuxer_t* demux_open_avi(demuxer_t* demuxer){

View File

@ -371,7 +371,6 @@ int demux_seek(struct demuxer *demuxer, float rel_seek_secs, float audio_delay,
// AVI demuxer params:
extern int index_mode; // -1=untouched 0=don't use index 1=use (generate) index
extern char *index_file_save, *index_file_load;
extern int force_ni;
extern int pts_from_bps;