|
|
|
@ -1664,9 +1664,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code |
|
|
|
|
#if CONFIG_ICONV |
|
|
|
|
iconv_t cd = iconv_open("UTF-8", avctx->sub_charenc); |
|
|
|
|
if (cd == (iconv_t)-1) { |
|
|
|
|
ret = AVERROR(errno); |
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Unable to open iconv context " |
|
|
|
|
"with input character encoding \"%s\"\n", avctx->sub_charenc); |
|
|
|
|
ret = AVERROR(errno); |
|
|
|
|
goto free_and_end; |
|
|
|
|
} |
|
|
|
|
iconv_close(cd); |
|
|
|
@ -2649,10 +2649,10 @@ static int recode_subtitle(AVCodecContext *avctx, |
|
|
|
|
if (iconv(cd, &inb, &inl, &outb, &outl) == (size_t)-1 || |
|
|
|
|
iconv(cd, NULL, NULL, &outb, &outl) == (size_t)-1 || |
|
|
|
|
outl >= outpkt->size || inl != 0) { |
|
|
|
|
ret = FFMIN(AVERROR(errno), -1); |
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Unable to recode subtitle event \"%s\" " |
|
|
|
|
"from %s to UTF-8\n", inpkt->data, avctx->sub_charenc); |
|
|
|
|
av_free_packet(&tmp); |
|
|
|
|
ret = AVERROR(errno); |
|
|
|
|
goto end; |
|
|
|
|
} |
|
|
|
|
outpkt->size -= outl; |
|
|
|
|