summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-12-07 19:44:29 +0100
committerwm4 <wm4@nowhere>2016-12-07 19:53:11 +0100
commit3eceac2eab0b42ee082a0b615ebf40a21f0fb915 (patch)
treea7f719897b49f44006d44a1efcdab3b8d203aad8 /demux
parenta660e15c9b96bd46209e78b3c3d4cf136a039a50 (diff)
downloadmpv-3eceac2eab0b42ee082a0b615ebf40a21f0fb915.tar.bz2
mpv-3eceac2eab0b42ee082a0b615ebf40a21f0fb915.tar.xz
Remove compatibility things
Possible with bumped FFmpeg/Libav. These are just the simple cases.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_lavf.c28
-rw-r--r--demux/stheader.h2
2 files changed, 2 insertions, 28 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 94bcd3fff6..124956378c 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -577,13 +577,8 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
AVFormatContext *avfc = priv->avfc;
AVStream *st = avfc->streams[i];
struct sh_stream *sh = NULL;
-#if HAVE_AVCODEC_HAS_CODECPAR
AVCodecParameters *codec = st->codecpar;
int lavc_delay = codec->initial_padding;
-#else
- AVCodecContext *codec = st->codec;
- int lavc_delay = codec->delay;
-#endif
switch (codec->codec_type) {
case AVMEDIA_TYPE_AUDIO: {
@@ -679,17 +674,9 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
sh->ff_index = st->index;
sh->codec->codec = mp_codec_from_av_codec_id(codec->codec_id);
sh->codec->codec_tag = codec->codec_tag;
-#if HAVE_AVCODEC_HAS_CODECPAR
sh->codec->lav_codecpar = avcodec_parameters_alloc();
if (sh->codec->lav_codecpar)
avcodec_parameters_copy(sh->codec->lav_codecpar, codec);
-#else
- sh->codec->codec = mp_codec_from_av_codec_id(codec->codec_id);
- sh->codec->codec_tag = codec->codec_tag;
- sh->codec->lav_headers = avcodec_alloc_context3(NULL);
- if (sh->codec->lav_headers)
- mp_copy_lav_codec_headers(sh->codec->lav_headers, codec);
-#endif
sh->codec->native_tb_num = st->time_base.num;
sh->codec->native_tb_den = st->time_base.den;
@@ -864,11 +851,9 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
.opaque = demuxer,
};
-#if HAVE_AVFORMAT_IOOPEN
avfc->opaque = demuxer;
if (!demuxer->access_references)
avfc->io_open = block_io_open;
-#endif
mp_set_avdict(&dopts, lavfdopts->avopts);
@@ -953,14 +938,9 @@ static int demux_lavf_fill_buffer(demuxer_t *demux)
if (pkt->dts != AV_NOPTS_VALUE)
dp->dts = pkt->dts * av_q2d(st->time_base);
dp->duration = pkt->duration * av_q2d(st->time_base);
-#if !HAVE_AV_AVPACKET_INT64_DURATION
- if (pkt->convergence_duration > 0)
- dp->duration = pkt->convergence_duration * av_q2d(st->time_base);
-#endif
dp->pos = pkt->pos;
dp->keyframe = pkt->flags & AV_PKT_FLAG_KEY;
-#if LIBAVFORMAT_VERSION_MICRO >= 100 && \
- LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 50, 100)
+#if LIBAVFORMAT_VERSION_MICRO >= 100
if (pkt->flags & AV_PKT_FLAG_DISCARD)
MP_ERR(demux, "Edit lists are not correctly supported (FFmpeg issue).\n");
#endif
@@ -1141,12 +1121,8 @@ static void demux_close_lavf(demuxer_t *demuxer)
av_freep(&priv->pb->buffer);
av_freep(&priv->pb);
for (int n = 0; n < priv->num_streams; n++) {
- if (priv->streams[n]) {
- avcodec_free_context(&priv->streams[n]->codec->lav_headers);
-#if HAVE_AVCODEC_HAS_CODECPAR
+ if (priv->streams[n])
avcodec_parameters_free(&priv->streams[n]->codec->lav_codecpar);
-#endif
- }
}
if (priv->own_stream)
free_stream(priv->stream);
diff --git a/demux/stheader.h b/demux/stheader.h
index 240be72a46..26c1246d66 100644
--- a/demux/stheader.h
+++ b/demux/stheader.h
@@ -71,8 +71,6 @@ struct mp_codec_params {
int extradata_size;
// Codec specific header data (set by demux_lavf.c only)
- // Which one is in use depends on HAVE_AVCODEC_HAS_CODECPAR.
- struct AVCodecContext *lav_headers;
struct AVCodecParameters *lav_codecpar;
// Timestamp granularity for converting double<->rational timestamps.