Ticket #2117: ticket_2117_attempt_2.diff

File ticket_2117_attempt_2.diff, 1.7 KB (added by skamithi, 18 years ago)

current patch that i'm testing. so far it fixes the crash, but not sure if its work on other dvds i have that have input changes.

  • libs/libmythtv/avformatdecoder.cpp

     
    325325        delete [] audioSamples;
    326326}
    327327
    328 void AvFormatDecoder::CloseContext()
     328void AvFormatDecoder::CloseCodecs()
    329329{
    330330    if (ic)
    331331    {
     
    336336            if (st->codec->codec)
    337337                avcodec_close(st->codec);
    338338        }
    339 
     339    }
     340}
     341   
     342void AvFormatDecoder::CloseContext()
     343{
     344    if (ic)
     345    {
     346        CloseCodecs();
     347       
    340348        ic->iformat->flags |= AVFMT_NOFILE;
    341349
    342350        av_free(ic->pb.buffer);
    343351        av_close_input_file(ic);
    344352        ic = NULL;
    345353    }
     354       
    346355    d->DestroyMPEG2();
    347356    h264_kf_seq->Reset();
    348357}
     
    26212630                if (video_width > 0 && video_width != current_width &&
    26222631                        !ringBuffer->DVD()->InStillFrame())
    26232632                {
     2633                    CloseCodecs();
    26242634                    av_free_packet(pkt);
    2625                     av_find_stream_info(ic);
    26262635                    ScanStreams(false);
    26272636                    allowedquit = true;
    26282637                    continue;
  • libs/libmythtv/avformatdecoder.h

     
    7676                    bool use_null_video_out, bool allow_libmpeg2 = true);
    7777   ~AvFormatDecoder();
    7878
     79    void CloseCodecs();
    7980    void CloseContext();
    8081    void Reset(void);
    8182    void Reset(bool reset_video_data = true, bool seek_reset = true);