[FFmpeg-devel] [PATCH 2/5] lavu/jni: add more JNI helper
Matthieu Bouron
matthieu.bouron at gmail.com
Sat Oct 10 11:09:55 CEST 2015
On Sat, Oct 10, 2015 at 03:18:38AM +0200, Michael Niedermayer wrote:
[...]
> > +
> > + if ((ret = avpriv_jni_exception_get_summary(env, exception, &message, log_ctx)) < 0) {
> > + return ret;
> > + }
> > +
> > + (*env)->DeleteLocalRef(env, exception);
> > +
> > + av_log(log_ctx, AV_LOG_ERROR, "%s\n", message);
> > + av_free(message);
> > +
>
> > + return -1;
>
> probably should be a AVERROR code, same for the other -1
>
Fixed locally by returning ret instead of -1.
>
> > +}
> > +
> > +int avpriv_jni_init_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfields_mapping, int global, void *log_ctx)
> > +{
> > + int i, ret = 0;
> > + jclass last_clazz = NULL;
> > +
> > + for (i = 0; jfields_mapping[i].name; i++) {
> > + int mandatory = jfields_mapping[i].mandatory;
> > + enum FFJniFieldType type = jfields_mapping[i].type;
> > +
> > + if (type == FF_JNI_CLASS) {
> > + jclass clazz;
> > +
> > + last_clazz = NULL;
> > +
> > + clazz = (*env)->FindClass(env, jfields_mapping[i].name);
>
> > + if ((ret = avpriv_jni_exception_check(env, mandatory, log_ctx) && mandatory) < 0) {
>
> the < 0 looks wrongly placed
Fixed locally.
Thanks for the review,
Matthieu
[...]
More information about the ffmpeg-devel
mailing list