havlenapetr / FFMpeg

this is port of ffmpeg for android (this is app, but in future i will do android lib from it and then system will be able to convert videos automatically)
881 stars 419 forks source link

call the method of " setDataSource() " before call the method of "prepare()" maybe happen #61

Open liugb opened 11 years ago

liugb commented 11 years ago

hi,havlenapetr

        try {
            FFMpeg ffmpeg = new FFMpeg();
            mMovieView = ffmpeg.getMovieView(this);
            try {
                mMovieView.setVideoPath(filePath);
            } catch (IllegalArgumentException e) {
                Log.e(TAG, "Can't set video: " + e.getMessage());
                FFMpegMessageBox.show(this, e);
            } catch (IllegalStateException e) {
                Log.e(TAG, "Can't set video: " + e.getMessage());
                FFMpegMessageBox.show(this, e);
            } catch (IOException e) {
                Log.e(TAG, "Can't set video: " + e.getMessage());
                FFMpegMessageBox.show(this, e);
            }
            setContentView(mMovieView);

    The code above ,I think maybe have problem.when initialize "mMovieView"  variable,this method of "initVideoView()"  is invoked,following call  this code of "surfHolder.addCallback()" .when call this method of " surfaceCreated ",the method of "prepare" is called .I think that call the method of " setDataSource() " before call the method of "prepare()"  maybe happen.