diff --git a/libavdevice/alsa-audio-dec.c b/libavdevice/alsa-audio-dec.c index 937f6a6ef74f97642564d04787979de3a75c1aaf..05f68d3cdc71fb36d70bf800ec6bc0a8bd13c550 100644 --- a/libavdevice/alsa-audio-dec.c +++ b/libavdevice/alsa-audio-dec.c @@ -60,14 +60,6 @@ static av_cold int audio_read_header(AVFormatContext *s1, enum CodecID codec_id; snd_pcm_sw_params_t *sw_params; -#if FF_API_FORMAT_PARAMETERS - if (ap->sample_rate > 0) - s->sample_rate = ap->sample_rate; - - if (ap->channels > 0) - s->channels = ap->channels; -#endif - st = av_new_stream(s1, 0); if (!st) { av_log(s1, AV_LOG_ERROR, "Cannot add stream\n"); diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index f1ae9ea6857a50254e304bd608247cdf55880d60..7ff46cf8a34f20c5a0894ba63826ee9b29c915d4 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -251,17 +251,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) AVRational framerate; int ret = 0; -#if FF_API_FORMAT_PARAMETERS - if (ap->standard) { - if (!strcasecmp(ap->standard, "pal")) - s->standard = PAL; - else if (!strcasecmp(ap->standard, "secam")) - s->standard = SECAM; - else if (!strcasecmp(ap->standard, "ntsc")) - s->standard = NTSC; - } -#endif - if ((ret = av_parse_video_size(&width, &height, s->video_size)) < 0) { av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n", s->video_size); goto out; @@ -281,14 +270,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate); goto out; } -#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 = av_new_stream(s1, 0); if (!st) { diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c index 565cf4cc4e42f57e2299b57bf951c9d96ac54eb9..5502fa2dbb4d5ad2e8427ae1395343655be971c2 100644 --- a/libavdevice/dv1394.c +++ b/libavdevice/dv1394.c @@ -90,18 +90,6 @@ static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap if (!dv->dv_demux) goto failed; -#if FF_API_FORMAT_PARAMETERS - if (ap->standard) { - if (!strcasecmp(ap->standard, "pal")) - dv->format = DV1394_PAL; - else - dv->format = DV1394_NTSC; - } - - if (ap->channel) - dv->channel = ap->channel; -#endif - /* Open and initialize DV1394 device */ dv->fd = open(context->filename, O_RDONLY); if (dv->fd < 0) { diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c index eb654aa4b34aefa0ffe8f70d0783b78d77917521..57c257f7b6ae748ea6a491d50d8e503737fc2892 100644 --- a/libavdevice/fbdev.c +++ b/libavdevice/fbdev.c @@ -107,10 +107,6 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", fbdev->framerate); return ret; } -#if FF_API_FORMAT_PARAMETERS - if (ap->time_base.num) - fbdev->framerate_q = (AVRational){ap->time_base.den, ap->time_base.num}; -#endif if (!(st = av_new_stream(avctx, 0))) return AVERROR(ENOMEM); diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c index e6161a1386d6ae526f2ab086fffd463a63c513c5..b6f53454a11707c1c7917b1fef15d8a464083efb 100644 --- a/libavdevice/libdc1394.c +++ b/libavdevice/libdc1394.c @@ -142,16 +142,6 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap, av_log(c, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", dc1394->framerate); goto out; } -#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 dc1394->frame_rate = av_rescale(1000, framerate.num, framerate.den); for (fmt = dc1394_frame_formats; fmt->width; fmt++) @@ -212,11 +202,6 @@ static int dc1394_v1_read_header(AVFormatContext *c, AVFormatParameters * ap) if (dc1394_read_common(c,ap,&fmt,&fps) != 0) return -1; -#if FF_API_FORMAT_PARAMETERS - if (ap->channel) - dc1394->channel = ap->channel; -#endif - /* Now let us prep the hardware. */ dc1394->handle = dc1394_create_handle(0); /* FIXME: gotta have ap->port */ if (!dc1394->handle) { diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index 6e25288dbaa94d4f0617ea6ea8f969e5d8f26264..6df7f34d7ee09ee49561c4eec088b67e91712926 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -209,13 +209,6 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap) AVStream *st; int ret; -#if FF_API_FORMAT_PARAMETERS - if (ap->sample_rate > 0) - s->sample_rate = ap->sample_rate; - if (ap->channels > 0) - s->channels = ap->channels; -#endif - st = av_new_stream(s1, 0); if (!st) { return AVERROR(ENOMEM); diff --git a/libavdevice/sndio_dec.c b/libavdevice/sndio_dec.c index 2690ee395cdadd3abf37f17c05e3f360e40f1d61..40e923660e1ea4432460793c5e643b7e4491797e 100644 --- a/libavdevice/sndio_dec.c +++ b/libavdevice/sndio_dec.c @@ -34,13 +34,6 @@ static av_cold int audio_read_header(AVFormatContext *s1, AVStream *st; int ret; -#if FF_API_FORMAT_PARAMETERS - if (ap->sample_rate > 0) - s->sample_rate = ap->sample_rate; - if (ap->channels > 0) - s->channels = ap->channels; -#endif - st = av_new_stream(s1, 0); if (!st) return AVERROR(ENOMEM); diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c index 1be7adf49d920ad3a480b7080badd6717525b3b9..b0f0452d8e2fb9814cc1d44c90a6025c631d5db5 100644 --- a/libavdevice/v4l.c +++ b/libavdevice/v4l.c @@ -142,16 +142,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) /* set tv standard */ if (!ioctl(video_fd, VIDIOCGTUNER, &tuner)) { -#if FF_API_FORMAT_PARAMETERS - if (ap->standard) { - if (!strcasecmp(ap->standard, "pal")) - s->standard = VIDEO_MODE_PAL; - else if (!strcasecmp(ap->standard, "secam")) - s->standard = VIDEO_MODE_SECAM; - else - s->standard = VIDEO_MODE_NTSC; - } -#endif tuner.mode = s->standard; ioctl(video_fd, VIDIOCSTUNER, &tuner); } diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 072be48d407def9738ce4e909bd068fc606aea27..7a501a901ce92bca7361114324942e49a8c14a01 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -463,12 +463,6 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate); return ret; } -#if FF_API_FORMAT_PARAMETERS - if (ap->channel > 0) - s->channel = ap->channel; - if (ap->time_base.num) - framerate_q = (AVRational){ap->time_base.den, ap->time_base.num}; -#endif /* set tv video input */ memset (&input, 0, sizeof (input)); @@ -486,13 +480,6 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) return AVERROR(EIO); } -#if FF_API_FORMAT_PARAMETERS - if (ap->standard) { - av_freep(&s->standard); - s->standard = av_strdup(ap->standard); - } -#endif - if (s->standard) { av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s\n", s->standard); @@ -609,14 +596,6 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) res = AVERROR(EINVAL); goto out; } -#if FF_API_FORMAT_PARAMETERS - if (ap->width > 0) - s->width = ap->width; - if (ap->height > 0) - s->height = ap->height; - if (ap->pix_fmt) - pix_fmt = ap->pix_fmt; -#endif capabilities = 0; s->fd = device_open(s1, &capabilities); diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index 80f9d00e9c7da822fee441d51871a045188eb541..47a9ebeb9c82bea40e4899e2c9ef0e943a69d082 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -267,11 +267,6 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) return AVERROR(EIO); } -#if FF_API_FORMAT_PARAMETERS - if (ap->time_base.num) - framerate_q = (AVRational){ap->time_base.den, ap->time_base.num}; -#endif - ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0); if(!ctx->hwnd) { av_log(s, AV_LOG_ERROR, "Could not create capture window.\n"); @@ -329,12 +324,6 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) goto fail_bi; } } -#if FF_API_FORMAT_PARAMETERS - if (ap->width > 0) - bi->bmiHeader.biWidth = ap->width; - if (ap->height > 0) - bi->bmiHeader.biHeight = ap->height; -#endif if (0) { /* For testing yet unsupported compressions diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index 09f6b511618cd069dc829861ead3b5d51a47de4f..5cc32dc20dfa0d6bdec9c30e49794161431c0b36 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -183,14 +183,6 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) av_log(s1, AV_LOG_ERROR, "Could not parse framerate: %s.\n", x11grab->framerate); goto out; } -#if FF_API_FORMAT_PARAMETERS - if (ap->width > 0) - x11grab->width = ap->width; - if (ap->height > 0) - x11grab->height = ap->height; - if (ap->time_base.num) - framerate = (AVRational){ap->time_base.den, ap->time_base.num}; -#endif av_log(s1, AV_LOG_INFO, "device: %s -> display: %s x: %d y: %d width: %d height: %d\n", s1->filename, param, x_off, y_off, x11grab->width, x11grab->height); diff --git a/libavformat/img2.c b/libavformat/img2.c index a4f39e72562e81898afc53b1ea3968e1c18ef0f4..935d7632881d7f4d4d184f053731d09e1eb2cb17 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 2bc66ac6859d29caede56d98b0c1cd5b5962ba2b..f22edec81a88f2e6255c5fab6ac10e2804756ffd 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 8f3fecb1e7c8e8976812bf2f4793ed24c98a2db6..76ab09c0e53b84dcf80e1b7e85bbc66ee3f152e8 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 430c086544041e8102d36394b5f7161cec79c372..88daa9df1ade9534c34503aa3ed54a0c8e8f2bf9 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 ee6b2f1334bfb3177275865b4e541ec666ebd046..58e29463469829e71092abb2d081f4fb67bc8348 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) {