diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-16 07:11:12 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-23 13:41:05 +0300 |
commit | 9b06b5ed85ec28097428e7fe35631ce3a04685b5 (patch) | |
tree | 8fbb0ad6eecb1f337e153d5c6eb7fa2378b805f4 /libmpdemux | |
parent | 0d59f81e546946648dfca93da6b74479d31369bc (diff) | |
download | mpv-9b06b5ed85ec28097428e7fe35631ce3a04685b5.tar.bz2 mpv-9b06b5ed85ec28097428e7fe35631ce3a04685b5.tar.xz |
Move correct_pts to options struct
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_lavf.c | 4 | ||||
-rw-r--r-- | libmpdemux/demux_mkv.c | 4 | ||||
-rw-r--r-- | libmpdemux/demuxer.c | 9 | ||||
-rw-r--r-- | libmpdemux/demuxer.h | 3 |
4 files changed, 9 insertions, 11 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 942a80fc56..ba898d10e4 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -22,6 +22,7 @@ #include <limits.h> #include "config.h" +#include "options.h" #include "mp_msg.h" #include "help_mp.h" @@ -405,6 +406,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { } static demuxer_t* demux_open_lavf(demuxer_t *demuxer){ + struct MPOpts *opts = demuxer->opts; AVFormatContext *avfc; AVFormatParameters ap; const AVOption *opt; @@ -420,7 +422,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){ if (opt_cryptokey) parse_cryptokey(avfc, opt_cryptokey); - if (user_correct_pts != 0) + if (opts->user_correct_pts != 0) avfc->flags |= AVFMT_FLAG_GENPTS; if (index_mode == 0) avfc->flags |= AVFMT_FLAG_IGNIDX; diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index 4fbc415cb0..59db246caa 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -13,6 +13,7 @@ #include <ctype.h> #include <inttypes.h> +#include "options.h" #include "stream/stream.h" #include "demuxer.h" #include "stheader.h" @@ -1687,6 +1688,7 @@ static const videocodec_info_t vinfo[] = { static int demux_mkv_open_video (demuxer_t *demuxer, mkv_track_t *track, int vid) { + struct MPOpts *opts = demuxer->opts; BITMAPINFOHEADER *bih; void *ImageDesc = NULL; sh_video_t *sh_v; @@ -1797,7 +1799,7 @@ demux_mkv_open_video (demuxer_t *demuxer, mkv_track_t *track, int vid) bih = realloc (bih, bih->biSize); memcpy (bih + 1, track->private_data, track->private_size); } - track->reorder_timecodes = user_correct_pts == 0; + track->reorder_timecodes = opts->user_correct_pts == 0; if (!vi->id) { mp_msg (MSGT_DEMUX,MSGL_WARN, MSGTR_MPDEMUX_MKV_UnknownCodecID, track->codec_id, track->tnum); diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index c11c8a035a..377b34fd08 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -738,9 +738,6 @@ int get_demuxer_type_from_name(char *demuxer_name, int *force) int extension_parsing = 1; // 0=off 1=mixed (used only for unstable formats) -int correct_pts = 0; -int user_correct_pts = -1; - /* NOTE : Several demuxers may be opened at the same time so demuxers should NEVER rely on an external var to enable them @@ -1045,9 +1042,9 @@ demuxer_t *demux_open(struct MPOpts *opts, stream_t *vs, int file_format, else res = vd; - correct_pts = user_correct_pts; - if (correct_pts < 0) - correct_pts = + opts->correct_pts = opts->user_correct_pts; + if (opts->correct_pts < 0) + opts->correct_pts = demux_control(res, DEMUXER_CTRL_CORRECT_PTS, NULL) == DEMUXER_CTRL_OK; return res; diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index e01e95e612..c61f564eb7 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -150,9 +150,6 @@ typedef struct demuxer_info_st { struct demuxer_st; -extern int correct_pts; -extern int user_correct_pts; - /** * Demuxer description structure */ |