diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-13 23:02:03 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-07-13 23:02:03 +0000 |
commit | b5de6c39e69206d8ac52a5d5230ddfd9bae21562 (patch) | |
tree | e7b1d5c160262f8f6241e1b22bc9cc761117fbd6 /libmpdemux | |
parent | 103fc6e176d4d9ec443b11c8a106e8081b129662 (diff) | |
download | mpv-b5de6c39e69206d8ac52a5d5230ddfd9bae21562.tar.bz2 mpv-b5de6c39e69206d8ac52a5d5230ddfd9bae21562.tar.xz |
Remove #if LIBAVCODEC_BUILD >= XXX and #if LIBAVFORMAT_BUILD >= XXX jungle.
It served no apparent purpose anymore.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19078 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_lavf.c | 22 | ||||
-rw-r--r-- | libmpdemux/muxer_lavf.c | 19 |
2 files changed, 3 insertions, 38 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 69e4ff9c51..f205928fd2 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -178,12 +178,8 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){ for(i=0; i<avfc->nb_streams; i++){ AVStream *st= avfc->streams[i]; -#if LIBAVFORMAT_BUILD >= 4629 AVCodecContext *codec= st->codec; -#else - AVCodecContext *codec= &st->codec; -#endif - + switch(codec->codec_type){ case CODEC_TYPE_AUDIO:{ WAVEFORMATEX *wf= calloc(sizeof(WAVEFORMATEX) + codec->extradata_size, 1); @@ -276,13 +272,8 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){ sh_video->video.dwRate= st->time_base.den; sh_video->video.dwScale= st->time_base.num; } else { -#if LIBAVFORMAT_BUILD >= 4624 sh_video->video.dwRate= codec->time_base.den; sh_video->video.dwScale= codec->time_base.num; -#else - sh_video->video.dwRate= codec->frame_rate; - sh_video->video.dwScale= codec->frame_rate_base; -#endif } sh_video->fps=av_q2d(st->r_frame_rate); sh_video->frametime=1/av_q2d(st->r_frame_rate); @@ -380,13 +371,8 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds){ } if(pkt.pts != AV_NOPTS_VALUE){ -#if LIBAVFORMAT_BUILD >= 4624 dp->pts=pkt.pts * av_q2d(priv->avfc->streams[id]->time_base); priv->last_pts= dp->pts * AV_TIME_BASE; -#else - priv->last_pts= pkt.pts; - dp->pts=pkt.pts / (float)AV_TIME_BASE; -#endif } dp->pos=demux->filepos; dp->flags= !!(pkt.flags&PKT_FLAG_KEY); @@ -398,12 +384,8 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds){ static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags){ lavf_priv_t *priv = demuxer->priv; mp_msg(MSGT_DEMUX,MSGL_DBG2,"demux_seek_lavf(%p, %f, %f, %d)\n", demuxer, rel_seek_secs, audio_delay, flags); - -#if LIBAVFORMAT_BUILD < 4619 - av_seek_frame(priv->avfc, -1, priv->last_pts + rel_seek_secs*AV_TIME_BASE); -#else + av_seek_frame(priv->avfc, -1, priv->last_pts + rel_seek_secs*AV_TIME_BASE, rel_seek_secs < 0 ? AVSEEK_FLAG_BACKWARD : 0); -#endif } static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg) diff --git a/libmpdemux/muxer_lavf.c b/libmpdemux/muxer_lavf.c index 46d292e829..c8601738e3 100644 --- a/libmpdemux/muxer_lavf.c +++ b/libmpdemux/muxer_lavf.c @@ -158,11 +158,7 @@ static muxer_stream_t* lavf_new_stream(muxer_t *muxer, int type) } spriv->avstream->stream_copy = 1; -#if LIBAVFORMAT_BUILD >= 4629 ctx = spriv->avstream->codec; -#else - ctx = &(spriv->avstream->codec); -#endif ctx->codec_id = muxer->avih.dwStreams; switch(type) { @@ -187,12 +183,8 @@ static void fix_parameters(muxer_stream_t *stream) muxer_stream_priv_t *spriv = (muxer_stream_priv_t *) stream->priv; AVCodecContext *ctx; -#if LIBAVFORMAT_BUILD >= 4629 ctx = spriv->avstream->codec; -#else - ctx = &(spriv->avstream->codec); -#endif - + if(stream->wf && stream->wf->nAvgBytesPerSec) ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8; ctx->rc_buffer_size= stream->vbv_size; @@ -236,13 +228,8 @@ static void fix_parameters(muxer_stream_t *stream) ctx->width = stream->bih->biWidth; ctx->height = stream->bih->biHeight; ctx->bit_rate = 800000; -#if (LIBAVFORMAT_BUILD >= 4624) ctx->time_base.den = stream->h.dwRate; ctx->time_base.num = stream->h.dwScale; -#else - ctx->frame_rate = stream->h.dwRate; - ctx->frame_rate_base = stream->h.dwScale; -#endif if(stream->bih+1 && (stream->bih->biSize > sizeof(BITMAPINFOHEADER))) { ctx->extradata = av_malloc(stream->bih->biSize - sizeof(BITMAPINFOHEADER)); @@ -279,11 +266,7 @@ static void write_chunk(muxer_stream_t *stream, size_t len, unsigned int flags, //pkt.pts = AV_NOPTS_VALUE; -#if LIBAVFORMAT_BUILD >= 4624 pkt.pts = (stream->timer / av_q2d(priv->oc->streams[pkt.stream_index]->time_base) + 0.5); -#else - pkt.pts = AV_TIME_BASE * stream->timer; -#endif //fprintf(stderr, "%Ld %Ld id:%d tb:%f %f\n", pkt.dts, pkt.pts, pkt.stream_index, av_q2d(priv->oc->streams[pkt.stream_index]->time_base), stream->timer); if(av_interleaved_write_frame(priv->oc, &pkt) != 0) //av_write_frame(priv->oc, &pkt) |