X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Fdoc%2Fexamples%2Ftranscoding.c;h=55724616164e19b0c77f8b3a86063dc4716f0a5d;hp=759c628e93713e3193e61c894b44af623d5afdd3;hb=dcebb6f35d810c9009a455808b016c790bb633b4;hpb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf diff --git a/ffmpeg/doc/examples/transcoding.c b/ffmpeg/doc/examples/transcoding.c index 759c628..5572461 100644 --- a/ffmpeg/doc/examples/transcoding.c +++ b/ffmpeg/doc/examples/transcoding.c @@ -116,6 +116,10 @@ static int open_output_file(const char *filename) || dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { /* in this example, we choose transcoding to same codec */ encoder = avcodec_find_encoder(dec_ctx->codec_id); + if (!encoder) { + av_log(NULL, AV_LOG_FATAL, "Neccessary encoder not found\n"); + return AVERROR_INVALIDDATA; + } /* In this example, we transcode to same properties (picture size, * sample rate etc.). These properties can be changed for output