Good Day.<br>I am using ffmepg (0.11) in android through JNI and i have with sucees been able to stream a video. However i am having a huge problem. If i go back and forth in my aplication in order to see several videos after the 4 or 5 video ffmpeg crash and does not output any error. Every time i start the activity that contains the JNI calls to ffmepg it start a new "running" of the ffmpeg.<br>
AVFormatContext *pFormatCtx;<br><br> int video_index = -1;<br> int audio_index = -1;<br> int i;<br><br> av_log_set_flags(AV_LOG_SKIP_REPEATED);<br> // Register all formats and codecs<br> avcodec_register_all();<br>
av_register_all();<br> avformat_network_init();<br>...<br>and then <br>it crashes in the decoding cycle..<br>AVPacket pkt1, *packet = &pkt1;<br><br> if(av_read_frame(global_video_state->pFormatCtx, packet) < 0) {<br>
decode_thread_fail();<br> decodingEnabled = 0;<br> }else{<br> int failed = 1;<br> if(packet->stream_index == global_video_state->videoStream) {<br>
//LOG_INFO("VIDEO");<br> av_free_packet(packet);<br> //failed=videoDecoderAddPacket(global_video_state,packet);<br> } else if(packet->stream_index == global_video_state->audioStream) {<br>
//LOG_INFO("AUDIO");<br> av_free_packet(packet);<br> //failed=audioDecoderAddPacket(packet);<br> } else {<br> av_free_packet(packet);<br>
}<br> if(failed==0){<br> decodingEnabled = 0;<br> decode_thread_fail();<br> }<br> }<br><br>as you can see i am not eveng processing the packets...<br>
<br>As i said.. this only occurs after several successfull....<br>i really need help..<br><br>Thanks..<br clear="all">------<br>Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.<br>