diff options
author | wm4 <wm4@nowhere> | 2012-10-28 20:13:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-30 19:50:21 +0100 |
commit | 042901940fc495f51cd23b9dee1daab089fad5b0 (patch) | |
tree | 060071096d6a2be8e1dcb69c6cb6b3b05c509d52 | |
parent | a04ad728c59410a13e43c5003da2ccc57fbd1218 (diff) | |
download | mpv-042901940fc495f51cd23b9dee1daab089fad5b0.tar.bz2 mpv-042901940fc495f51cd23b9dee1daab089fad5b0.tar.xz |
options, avi: remove -loadidx/-saveidx
This was probably useless even many years ago.
-rw-r--r-- | DOCS/man/en/options.rst | 15 | ||||
-rw-r--r-- | cfg-mplayer.h | 2 | ||||
-rw-r--r-- | libmpdemux/aviheader.c | 59 | ||||
-rw-r--r-- | libmpdemux/demux_avi.c | 1 | ||||
-rw-r--r-- | libmpdemux/demuxer.h | 1 |
5 files changed, 0 insertions, 78 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index a8fe171601..1c1a9a842d 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -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``. diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 011b0c568d..762dd0ed95 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -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), diff --git a/libmpdemux/aviheader.c b/libmpdemux/aviheader.c index 1b0683339e..0c47386dc5 100644 --- a/libmpdemux/aviheader.c +++ b/libmpdemux/aviheader.c @@ -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); - } } } diff --git a/libmpdemux/demux_avi.c b/libmpdemux/demux_avi.c index 3841cf2736..69fdd4ffd5 100644 --- a/libmpdemux/demux_avi.c +++ b/libmpdemux/demux_avi.c @@ -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){ diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index 8c04c9dad6..24d4c44cdd 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -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; |