Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bb13573 authored by Gil Dobjanschi's avatar Gil Dobjanschi
Browse files

Bug fix: 3405930 Crash editing overlay text

Change-Id: Icd304ef8dde2b41812b14857dc3c112cc22d578e
parent cde85d57
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -270,11 +270,13 @@ public class AudioTrack {
        if (volumePercent < 0) {
            throw new IllegalArgumentException("Invalid Volume ");
        }
        mVolumePercent = volumePercent;

        /**
         *  Force update of preview settings
         */
        mMANativeHelper.setGeneratePreview(true);

        mVolumePercent = volumePercent;
    }

    /**
@@ -294,11 +296,11 @@ public class AudioTrack {
     *         the volume of this Audio Track to 0.
     */
    public void setMute(boolean muted) {
        mMuted = muted;
        /**
         *  Force update of preview settings
         */
        mMANativeHelper.setGeneratePreview(true);
        mMuted = muted;
    }

    /**
@@ -363,14 +365,15 @@ public class AudioTrack {
            throw new IllegalArgumentException("Invalid end time; is < 0");
        }

        mBeginBoundaryTimeMs = beginMs;
        mEndBoundaryTimeMs = endMs;

        mTimelineDurationMs = mEndBoundaryTimeMs - mBeginBoundaryTimeMs;
        /**
         *  Force update of preview settings
         */
        mMANativeHelper.setGeneratePreview(true);

        mBeginBoundaryTimeMs = beginMs;
        mEndBoundaryTimeMs = endMs;

        mTimelineDurationMs = mEndBoundaryTimeMs - mBeginBoundaryTimeMs;
    }

    /**
@@ -412,11 +415,11 @@ public class AudioTrack {
     */
    public void disableLoop() {
        if (mLoop) {
            mLoop = false;
            /**
             *  Force update of preview settings
             */
            mMANativeHelper.setGeneratePreview(true);
            mLoop = false;
        }
    }

@@ -434,11 +437,11 @@ public class AudioTrack {
     */
    public void disableDucking() {
        if (mIsDuckingEnabled) {
            mIsDuckingEnabled = false;
            /**
             *  Force update of preview settings
             */
            mMANativeHelper.setGeneratePreview(true);
            mIsDuckingEnabled = false;
        }
    }

@@ -462,13 +465,14 @@ public class AudioTrack {
                    + duckedTrackVolume);
        }

        mDuckingThreshold = threshold;
        mDuckedTrackVolume = duckedTrackVolume;
        mIsDuckingEnabled = true;
        /**
         *  Force update of preview settings
         */
        mMANativeHelper.setGeneratePreview(true);

        mDuckingThreshold = threshold;
        mDuckedTrackVolume = duckedTrackVolume;
        mIsDuckingEnabled = true;
    }

    /**
+4 −6
Original line number Diff line number Diff line
@@ -105,8 +105,7 @@ public abstract class Effect {
        final long oldDurationMs = mDurationMs;
        mDurationMs = durationMs;

        mMediaItem.invalidateTransitions(mStartTimeMs, oldDurationMs,
                                         mStartTimeMs, mDurationMs);
        mMediaItem.invalidateTransitions(mStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs);
    }

    /**
@@ -130,11 +129,11 @@ public abstract class Effect {
            throw new IllegalArgumentException("Start time is too large");
        }

        getMediaItem().getNativeContext().setGeneratePreview(true);
        final long oldStartTimeMs = mStartTimeMs;
        mStartTimeMs = startTimeMs;

        mMediaItem.invalidateTransitions(oldStartTimeMs, mDurationMs,
                                         mStartTimeMs, mDurationMs);
        mMediaItem.invalidateTransitions(oldStartTimeMs, mDurationMs, mStartTimeMs, mDurationMs);
    }

    /**
@@ -163,8 +162,7 @@ public abstract class Effect {
        mStartTimeMs = startTimeMs;
        mDurationMs = durationMs;

        mMediaItem.invalidateTransitions(oldStartTimeMs, oldDurationMs,
                                         mStartTimeMs, mDurationMs);
        mMediaItem.invalidateTransitions(oldStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs);
    }

    /**
+250 −421

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -294,6 +294,8 @@ public class MediaImageItem extends MediaItem {
            return;
        }

        mMANativeHelper.setGeneratePreview(true);

        /**
         * Invalidate the end transitions if necessary.
         * This invalidation is necessary for the case in which an effect or
+24 −26
Original line number Diff line number Diff line
@@ -176,6 +176,9 @@ public abstract class MediaItem {
            default:
                throw new IllegalArgumentException("Invalid Rendering Mode");
        }

        mMANativeHelper.setGeneratePreview(true);

        mRenderingMode = renderingMode;
        if (mBeginTransition != null) {
            mBeginTransition.invalidate();
@@ -184,7 +187,6 @@ public abstract class MediaItem {
        if (mEndTransition != null) {
            mEndTransition.invalidate();
        }
        mMANativeHelper.setGeneratePreview(true);
    }

    /**
@@ -296,13 +298,12 @@ public abstract class MediaItem {
        mEffects.add(effect);

        invalidateTransitions(effect.getStartTime(), effect.getDuration());
        if (mMANativeHelper != null) {

        if (effect instanceof EffectKenBurns) {
            mRegenerateClip = true;
        }
        mMANativeHelper.setGeneratePreview(true);
    }
    }

    /**
     * Remove the effect with the specified id.
@@ -318,9 +319,11 @@ public abstract class MediaItem {
    public Effect removeEffect(String effectId) {
        for (Effect effect : mEffects) {
            if (effect.getId().equals(effectId)) {
                mMANativeHelper.setGeneratePreview(true);

                mEffects.remove(effect);

                invalidateTransitions(effect.getStartTime(), effect.getDuration());
                if (mMANativeHelper != null) {
                if (effect instanceof EffectKenBurns) {
                    if (mGeneratedImageClip != null) {
                        /**
@@ -334,8 +337,6 @@ public abstract class MediaItem {
                    }
                    mRegenerateClip = false;
                }
                    mMANativeHelper.setGeneratePreview(true);
                }
                return effect;
            }
        }
@@ -448,10 +449,8 @@ public abstract class MediaItem {

        mOverlays.add(overlay);
        invalidateTransitions(overlay.getStartTime(), overlay.getDuration());
        if (mMANativeHelper != null) {
        mMANativeHelper.setGeneratePreview(true);
    }
    }

    /**
     * @param flag The flag to indicate if regeneration of clip is true or
@@ -483,10 +482,9 @@ public abstract class MediaItem {
    public Overlay removeOverlay(String overlayId) {
        for (Overlay overlay : mOverlays) {
            if (overlay.getId().equals(overlayId)) {
                mOverlays.remove(overlay);
                if (mMANativeHelper != null) {
                mMANativeHelper.setGeneratePreview(true);
                }

                mOverlays.remove(overlay);
                if (overlay instanceof OverlayFrame) {
                    ((OverlayFrame)overlay).invalidate();
                }
Loading