Ticket #4925: attempt_resolve_crashes_after_removing_streams.diff
File attempt_resolve_crashes_after_removing_streams.diff, 1.9 KB (added by , 16 years ago) |
---|
-
libmythtv/avformatdecoder.cpp
1994 1994 AVStream *st = ic->streams[i]; 1995 1995 if (st->codec->codec_type == CODEC_TYPE_AUDIO) 1996 1996 { 1997 avcodec_flush_buffers(st->codec); 1997 1998 av_remove_stream(ic, st->id, 0); 1998 1999 i--; 1999 2000 } 2000 2001 else 2001 2002 i++; 2002 2003 } 2003 av_read_frame_flush(ic);2004 2004 } 2005 2005 2006 2006 void release_avf_buffer(struct AVCodecContext *c, AVFrame *pic) -
libavcodec/utils.c
1269 1269 1270 1270 void avcodec_flush_buffers(AVCodecContext *avctx) 1271 1271 { 1272 if(avctx->codec ->flush)1272 if(avctx->codec && avctx->codec->flush) 1273 1273 avctx->codec->flush(avctx); 1274 1274 } 1275 1275 -
libavformat/utils.c
581 581 *pnum = 0; 582 582 *pden = 0; 583 583 584 if (!st || !st->codec )584 if (!st || !st->codec || !pc) 585 585 return; 586 586 587 587 switch(st->codec->codec_type) { … … 690 690 } 691 691 692 692 /* do we have a video B frame ? */ 693 delay= st->codec->has_b_frames;693 delay= (pc) ? st->codec->has_b_frames : 0; 694 694 presentation_delayed = 0; 695 695 /* XXX: need has_b_frame, but cannot get it if the codec is 696 696 not initialized */ … … 765 765 // av_log(NULL, AV_LOG_ERROR, "OUTdelayed:%d/%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64"\n", presentation_delayed, delay, pkt->pts, pkt->dts, st->cur_dts); 766 766 767 767 /* update flags */ 768 if( is_intra_only(st->codec))768 if(pc && is_intra_only(st->codec)) 769 769 pkt->flags |= PKT_FLAG_KEY; 770 770 else if (pc) { 771 771 pkt->flags = 0;