summaryrefslogtreecommitdiff
path: root/libavcodec/libopenjpegdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-26 21:36:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-26 21:37:15 +0200
commit7333798c85837f1cf175f39bc4acb5664fa6cacc (patch)
tree60036638a0962b3cb966d62da2eda81f93ac3267 /libavcodec/libopenjpegdec.c
parent307a20cca216356aec30f5bb102c633169cbc0c1 (diff)
parent44dc9c6af0377faf2a99889d1f949e32a1102e84 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: libopenjpeg: support YUV and deep RGB pixel formats Fix typo in v410 decoder. vf_yadif: unset cur_buf on the input link. vf_overlay: ensure the overlay frame does not get leaked. vf_overlay: prevent premature freeing of cur_buf Support urlencoded http authentication credentials rtmp: Return an error when the client bandwidth is incorrect rtmp: Return proper error code in handle_server_bw rtmp: Return proper error code in handle_client_bw rtmp: Return proper error codes in handle_chunk_size lavr: x86: add missing vzeroupper in ff_mix_1_to_2_fltp_flt() vp8: Replace x*155/100 by x*101581>>16. vp3: don't use calls to inline asm in yasm code. x86/dsputil: put inline asm under HAVE_INLINE_ASM. dsputil_mmx: fix incorrect assembly code rtmp: Factorize the code by adding handle_invoke rtmp: Factorize the code by adding handle_chunk_size rtmp: Factorize the code by adding handle_ping rtmp: Factorize the code by adding handle_client_bw rtmp: Factorize the code by adding handle_server_bw Conflicts: libavcodec/libopenjpegdec.c libavcodec/x86/dsputil_mmx.c libavfilter/vf_overlay.c libavformat/Makefile libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libopenjpegdec.c')
-rw-r--r--libavcodec/libopenjpegdec.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 333955feb0..bb7b497d58 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -27,9 +27,9 @@
#define OPJ_STATIC
#include <openjpeg.h>
+#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixfmt.h"
-#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "thread.h"
@@ -293,15 +293,12 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
avcodec_set_dimensions(avctx, width, height);
- if (avctx->pix_fmt != PIX_FMT_NONE) {
- if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt)) {
+ if (avctx->pix_fmt != PIX_FMT_NONE)
+ if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt))
avctx->pix_fmt = PIX_FMT_NONE;
- }
- }
- if (avctx->pix_fmt == PIX_FMT_NONE) {
+ if (avctx->pix_fmt == PIX_FMT_NONE)
avctx->pix_fmt = libopenjpeg_guess_pix_fmt(image);
- }
if (avctx->pix_fmt == PIX_FMT_NONE) {
av_log(avctx, AV_LOG_ERROR, "Unable to determine pixel format\n");
@@ -331,9 +328,10 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
}
opj_image_destroy(image);
- // Decode the codestream.
+ // Decode the codestream
image = opj_decode_with_info(dec, stream, NULL);
opj_cio_close(stream);
+
if (!image) {
av_log(avctx, AV_LOG_ERROR, "Error decoding codestream.\n");
goto done;