diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-07-17 07:45:33 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-08-15 19:59:48 +0200 |
commit | c14fe6bc99eba55c6e52b3f3c606bb458f8a0a8e (patch) | |
tree | cfa74cd6c190a908314abca96d9c2f2f59b1d7fb /libavformat | |
parent | a7c93dae55c045499ffb34a84f8d5031ae594cf9 (diff) | |
download | ffmpeg-c14fe6bc99eba55c6e52b3f3c606bb458f8a0a8e.tar.gz |
lavf,lavd: remove all usage of AVFormatParameters from demuxers.
AVFormatParameters are converted into corresponding private options in
av_open_input_file/stream() compat wrappers, so accessing them from
demuxers is redundant.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/img2.c | 10 | ||||
-rw-r--r-- | libavformat/mpegts.c | 7 | ||||
-rw-r--r-- | libavformat/rawdec.c | 22 | ||||
-rw-r--r-- | libavformat/rtspdec.c | 5 | ||||
-rw-r--r-- | libavformat/tty.c | 12 |
5 files changed, 1 insertions, 55 deletions
diff --git a/libavformat/img2.c b/libavformat/img2.c index a4f39e7256..935d763288 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -233,16 +233,6 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate); return ret; } -#if FF_API_FORMAT_PARAMETERS - if (ap->pix_fmt != PIX_FMT_NONE) - pix_fmt = ap->pix_fmt; - if (ap->width > 0) - width = ap->width; - if (ap->height > 0) - height = ap->height; - if (ap->time_base.num) - framerate = (AVRational){ap->time_base.den, ap->time_base.num}; -#endif #if FF_API_LOOP_INPUT if (s1->loop_input) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 2bc66ac685..f22edec81a 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1508,13 +1508,6 @@ static int mpegts_read_header(AVFormatContext *s, int len; int64_t pos; -#if FF_API_FORMAT_PARAMETERS - if (ap) { - if (ap->mpeg2ts_compute_pcr) - ts->mpeg2ts_compute_pcr = ap->mpeg2ts_compute_pcr; - } -#endif - /* read the first 1024 bytes to get packet size */ pos = avio_tell(pb); len = avio_read(pb, buf, sizeof(buf)); diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index 8f3fecb1e7..76ab09c0e5 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -49,13 +49,7 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) case AVMEDIA_TYPE_AUDIO: { RawAudioDemuxerContext *s1 = s->priv_data; -#if FF_API_FORMAT_PARAMETERS - if (ap->sample_rate) - st->codec->sample_rate = ap->sample_rate; - if (ap->channels) - st->codec->channels = ap->channels; - else st->codec->channels = 1; -#endif + st->codec->channels = 1; if (s1->sample_rate) st->codec->sample_rate = s1->sample_rate; @@ -87,16 +81,6 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate); goto fail; } -#if FF_API_FORMAT_PARAMETERS - if (ap->width > 0) - width = ap->width; - if (ap->height > 0) - height = ap->height; - if (ap->pix_fmt) - pix_fmt = ap->pix_fmt; - if (ap->time_base.num) - framerate = (AVRational){ap->time_base.den, ap->time_base.num}; -#endif av_set_pts_info(st, 64, framerate.den, framerate.num); st->codec->width = width; st->codec->height = height; @@ -170,10 +154,6 @@ int ff_raw_video_read_header(AVFormatContext *s, av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate); goto fail; } -#if FF_API_FORMAT_PARAMETERS - if (ap->time_base.num) - framerate = (AVRational){ap->time_base.den, ap->time_base.num}; -#endif st->codec->time_base = (AVRational){framerate.den, framerate.num}; av_set_pts_info(st, 64, 1, 1200000); diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 430c086544..88daa9df1a 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -164,11 +164,6 @@ static int rtsp_read_header(AVFormatContext *s, return AVERROR(ENOMEM); rt->real_setup = rt->real_setup_cache + s->nb_streams; -#if FF_API_FORMAT_PARAMETERS - if (ap->initial_pause) - rt->initial_pause = ap->initial_pause; -#endif - if (rt->initial_pause) { /* do not start immediately */ } else { diff --git a/libavformat/tty.c b/libavformat/tty.c index ee6b2f1334..58e2946346 100644 --- a/libavformat/tty.c +++ b/libavformat/tty.c @@ -95,23 +95,11 @@ static int read_header(AVFormatContext *avctx, av_log(avctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate); goto fail; } -#if FF_API_FORMAT_PARAMETERS - if (ap->width > 0) - width = ap->width; - if (ap->height > 0) - height = ap->height; - if (ap->time_base.num) - framerate = (AVRational){ap->time_base.den, ap->time_base.num}; -#endif st->codec->width = width; st->codec->height = height; av_set_pts_info(st, 60, framerate.den, framerate.num); /* simulate tty display speed */ -#if FF_API_FORMAT_PARAMETERS - if (ap->sample_rate) - s->chars_per_frame = ap->sample_rate; -#endif s->chars_per_frame = FFMAX(av_q2d(st->time_base)*s->chars_per_frame, 1); if (avctx->pb->seekable) { |