avdevice/decklink_dec: remove the @mode syntax

Deprecated since March 28, 2017.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint
2019-08-21 22:40:11 +02:00
parent d111a41f9d
commit 78a233e6e9
3 changed files with 12 additions and 24 deletions

View File

@@ -1005,9 +1005,6 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
class decklink_input_callback *input_callback;
AVStream *st;
HRESULT result;
char fname[1024];
char *tmp;
int mode_num = 0;
int ret;
ctx = (struct decklink_ctx *) av_mallocz(sizeof(struct decklink_ctx));
@@ -1062,15 +1059,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
cctx->raw_format = MKBETAG('v','2','1','0');
}
av_strlcpy(fname, avctx->url, sizeof(fname));
tmp=strchr (fname, '@');
if (tmp != NULL) {
av_log(avctx, AV_LOG_WARNING, "The @mode syntax is deprecated and will be removed. Please use the -format_code option.\n");
mode_num = atoi (tmp+1);
*tmp = 0;
}
ret = ff_decklink_init_device(avctx, fname);
ret = ff_decklink_init_device(avctx, avctx->url);
if (ret < 0)
return ret;
@@ -1111,7 +1100,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
goto error;
}
if (mode_num == 0 && !cctx->format_code) {
if (!cctx->format_code) {
if (decklink_autodetect(cctx) < 0) {
av_log(avctx, AV_LOG_ERROR, "Cannot Autodetect input stream or No signal\n");
ret = AVERROR(EIO);
@@ -1119,9 +1108,9 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
}
av_log(avctx, AV_LOG_INFO, "Autodetected the input mode\n");
}
if (ff_decklink_set_format(avctx, DIRECTION_IN, mode_num) < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not set mode number %d or format code %s for %s\n",
mode_num, (cctx->format_code) ? cctx->format_code : "(unset)", fname);
if (ff_decklink_set_format(avctx, DIRECTION_IN) < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not set format code %s for %s\n",
cctx->format_code ? cctx->format_code : "(unset)", avctx->url);
ret = AVERROR(EIO);
goto error;
}