mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 21:12:23 +00:00
demux: remove unused audio_delay parameter from demux_seek()
Used to be needed by demux_avi.
This commit is contained in:
parent
bc0abebe8e
commit
1e649f353b
@ -624,8 +624,7 @@ void demux_flush(demuxer_t *demuxer)
|
||||
demuxer->warned_queue_overflow = false;
|
||||
}
|
||||
|
||||
int demux_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_delay,
|
||||
int flags)
|
||||
int demux_seek(demuxer_t *demuxer, float rel_seek_secs, int flags)
|
||||
{
|
||||
if (!demuxer->seekable) {
|
||||
mp_tmsg(MSGT_SEEK, MSGL_WARN, "Cannot seek in this file.\n");
|
||||
@ -672,7 +671,7 @@ int demux_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_delay,
|
||||
|
||||
dmx_seek:
|
||||
if (demuxer->desc->seek)
|
||||
demuxer->desc->seek(demuxer, rel_seek_secs, audio_delay, flags);
|
||||
demuxer->desc->seek(demuxer, rel_seek_secs, flags);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -107,8 +107,7 @@ typedef struct demuxer_desc {
|
||||
// The following functions are all optional
|
||||
int (*fill_buffer)(struct demuxer *demuxer); // 0 on EOF, otherwise 1
|
||||
void (*close)(struct demuxer *demuxer);
|
||||
void (*seek)(struct demuxer *demuxer, float rel_seek_secs,
|
||||
float audio_delay, int flags);
|
||||
void (*seek)(struct demuxer *demuxer, float rel_seek_secs, int flags);
|
||||
int (*control)(struct demuxer *demuxer, int cmd, void *arg);
|
||||
} demuxer_desc_t;
|
||||
|
||||
@ -222,8 +221,7 @@ struct demuxer *demux_open(struct stream *stream, char *force_format,
|
||||
struct demuxer_params *params, struct MPOpts *opts);
|
||||
|
||||
void demux_flush(struct demuxer *demuxer);
|
||||
int demux_seek(struct demuxer *demuxer, float rel_seek_secs, float audio_delay,
|
||||
int flags);
|
||||
int demux_seek(struct demuxer *demuxer, float rel_seek_secs, int flags);
|
||||
|
||||
int demux_info_add(struct demuxer *demuxer, const char *opt, const char *param);
|
||||
int demux_info_add_bstr(struct demuxer *demuxer, struct bstr opt,
|
||||
|
@ -804,13 +804,12 @@ static int demux_lavf_fill_buffer(demuxer_t *demux)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs,
|
||||
float audio_delay, int flags)
|
||||
static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs, int flags)
|
||||
{
|
||||
lavf_priv_t *priv = demuxer->priv;
|
||||
int avsflags = 0;
|
||||
mp_msg(MSGT_DEMUX, MSGL_DBG2, "demux_seek_lavf(%p, %f, %f, %d)\n",
|
||||
demuxer, rel_seek_secs, audio_delay, flags);
|
||||
mp_msg(MSGT_DEMUX, MSGL_DBG2, "demux_seek_lavf(%p, %f, %d)\n",
|
||||
demuxer, rel_seek_secs, flags);
|
||||
|
||||
seek_reset(demuxer);
|
||||
|
||||
|
@ -47,7 +47,8 @@ static void free_mf(mf_t *mf)
|
||||
}
|
||||
}
|
||||
|
||||
static void demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,float audio_delay,int flags){
|
||||
static void demux_seek_mf(demuxer_t *demuxer, float rel_seek_secs, int flags)
|
||||
{
|
||||
mf_t * mf = (mf_t *)demuxer->priv;
|
||||
int newpos = (flags & SEEK_ABSOLUTE)?0:mf->curr_frame - 1;
|
||||
|
||||
|
@ -2577,8 +2577,7 @@ static struct mkv_index *seek_with_cues(struct demuxer *demuxer, int seek_id,
|
||||
return index;
|
||||
}
|
||||
|
||||
static void demux_mkv_seek(demuxer_t *demuxer, float rel_seek_secs,
|
||||
float audio_delay, int flags)
|
||||
static void demux_mkv_seek(demuxer_t *demuxer, float rel_seek_secs, int flags)
|
||||
{
|
||||
mkv_demuxer_t *mkv_d = demuxer->priv;
|
||||
int64_t old_pos = stream_tell(demuxer->stream);
|
||||
|
@ -457,8 +457,7 @@ static void demux_mng_close(demuxer_t* demuxer)
|
||||
* \param[in] audio_delay unused, MNG does not contain audio
|
||||
* \param[in] flags bit flags, \p 1: absolute, \p 2: fractional position
|
||||
*/
|
||||
static void demux_mng_seek(demuxer_t * demuxer, float rel_seek_secs,
|
||||
float audio_delay, int flags)
|
||||
static void demux_mng_seek(demuxer_t * demuxer, float rel_seek_secs, int flags)
|
||||
{
|
||||
mng_priv_t * mng_priv = demuxer->priv;
|
||||
mng_handle h_mng = mng_priv->h_mng;
|
||||
|
@ -217,8 +217,7 @@ static int raw_fill_buffer(demuxer_t *demuxer)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void raw_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_delay,
|
||||
int flags)
|
||||
static void raw_seek(demuxer_t *demuxer, float rel_seek_secs, int flags)
|
||||
{
|
||||
struct priv *p = demuxer->priv;
|
||||
stream_t *s = demuxer->stream;
|
||||
|
@ -1369,8 +1369,7 @@ static int d_fill_buffer(struct demuxer *demuxer)
|
||||
return demuxer_add_packet(demuxer, p->sh, dp);
|
||||
}
|
||||
|
||||
static void d_seek(struct demuxer *demuxer, float secs, float audio_delay,
|
||||
int flags)
|
||||
static void d_seek(struct demuxer *demuxer, float secs, int flags)
|
||||
{
|
||||
struct priv *p = demuxer->priv;
|
||||
demux_packet_list_seek(p->pkts, p->num_pkts, &p->current, secs, flags);
|
||||
|
@ -391,7 +391,7 @@ static void init_demux_stream(struct MPContext *mpctx, enum stream_type type)
|
||||
demuxer_switch_track(stream->demuxer, type, stream);
|
||||
if (track->is_external) {
|
||||
double pts = get_main_demux_pts(mpctx);
|
||||
demux_seek(stream->demuxer, pts, mpctx->audio_delay, SEEK_ABSOLUTE);
|
||||
demux_seek(stream->demuxer, pts, SEEK_ABSOLUTE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1971,7 +1971,7 @@ static void reinit_subs(struct MPContext *mpctx)
|
||||
// if it has only sub streams, because reading packets will change the
|
||||
// demuxer position.
|
||||
if (!track->preloaded && track->is_external) {
|
||||
demux_seek(track->demuxer, 0, 0, SEEK_ABSOLUTE);
|
||||
demux_seek(track->demuxer, 0, SEEK_ABSOLUTE);
|
||||
track->preloaded = sub_read_all_packets(dec_sub, sh_sub);
|
||||
}
|
||||
}
|
||||
@ -2976,8 +2976,7 @@ static int seek(MPContext *mpctx, struct seek_params seek,
|
||||
|
||||
if (hr_seek)
|
||||
demuxer_amount -= opts->hr_seek_demuxer_offset;
|
||||
int seekresult = demux_seek(mpctx->demuxer, demuxer_amount,
|
||||
mpctx->audio_delay, demuxer_style);
|
||||
int seekresult = demux_seek(mpctx->demuxer, demuxer_amount, demuxer_style);
|
||||
if (seekresult == 0) {
|
||||
if (need_reset) {
|
||||
reinit_audio_chain(mpctx);
|
||||
@ -3002,8 +3001,7 @@ static int seek(MPContext *mpctx, struct seek_params seek,
|
||||
for (int type = 0; type < STREAM_TYPE_COUNT; type++) {
|
||||
struct track *track = mpctx->current_track[type];
|
||||
if (track && track->is_external && track->demuxer)
|
||||
demux_seek(track->demuxer, main_new_pos, mpctx->audio_delay,
|
||||
SEEK_ABSOLUTE);
|
||||
demux_seek(track->demuxer, main_new_pos, SEEK_ABSOLUTE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user