Skip to content

carsh when recoder output hls  #1082

@buhe

Description

@buhe

Hi, i mix 2 audio to 1 audio and output to hls format, app is crash when recorder.stop()
I debug the app, the crash code is av_write_frame(oc, null);

public void stop() throws Exception {
        if (oc != null) {
            try {
                synchronized (oc) {
                    /* flush all the buffers */
                    while (video_st != null && ifmt_ctx == null && recordImage(0, 0, 0, 0, 0, AV_PIX_FMT_NONE, (Buffer[])null));
                    while (audio_st != null && ifmt_ctx == null && recordSamples(0, 0, (Buffer[])null));

                    if (interleaved && video_st != null && audio_st != null) {
                        av_interleaved_write_frame(oc, null);
                    } else {
                        av_write_frame(oc, null);   <--- app crash here
                    }

                    /* write the trailer, if any */
                    av_write_trailer(oc);
                }
            } finally {
                release();
            }
        }
    }

Finally, i have a 43 ts file ,but m3u8 file has only 42 ts

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions