Ticket #2077: mythtransode-ac3.diff

File mythtransode-ac3.diff, 3.1 KB (added by Nicolas Pöhlmann <nicolas.poehlmann@…>, 11 years ago)

AC3 deadlock patch

  • external/FFmpeg/libavcodec/

    old new  
    9393            avctx->channels = s->channels;
    9494            avctx->channel_layout = s->channel_layout;
    9595        }
     96         avctx->frame_size = s->samples;
    9697        s1->duration = s->samples;
    9798        avctx->audio_service_type = s->service_type;
    9899    }
  • programs/mythtranscode/mpeg2fix.cpp

     
    470470
    471471int MPEG2replex::WaitBuffers()
    472472{
    473     pthread_mutex_lock( &mutex );
     473    pthread_mutex_lock(&mutex);
    474474    while (1)
    475475    {
    476476        int i, ok = 1;
     
    19381947
    19391948    initPTS = vFrame.first()->pkt.pts;
    19401949
    1941     LOG(VB_GENERAL, LOG_INFO, QString("#%1 PTS:%2 Delta: 0.0ms queue: %3")
     1950    LOG(VB_GENERAL, LOG_INFO, QString("VID #%1 PTS:%2 Delta: 0.0ms queue: %3")
    19421951            .arg(vid_id).arg(PtsTime(vFrame.first()->pkt.pts))
    19431952            .arg(vFrame.count()));
    19441953
     
    19471956        FrameList *af = (*it);
    19481957        deltaPTS = diff2x33(vFrame.first()->pkt.pts, af->first()->pkt.pts);
    19491958        LOG(VB_GENERAL, LOG_INFO,
    1950             QString("#%1 PTS:%2 Delta: %3ms queue: %4")
     1959            QString("AUD #%1 PTS:%2 Delta: %3ms queue: %4")
    19511960                .arg(it.key()) .arg(PtsTime(af->first()->pkt.pts))
    19521961                .arg(1000.0*deltaPTS / 90000.0).arg(af->count()));
    19531962
     
    20012010            displayFrame = 0;
    20022011
    20032012            // since we might reorder the frames when coming out of a cutpoint
    2004             // me need to save the first frame here, as it is guaranteed to
     2013            // we need to save the first frame here, as it is guaranteed to
    20052014            // have a sequence header.
    20062015            MPEG2frame *seqFrame = vFrame.first();
    20072016
     
    23582367            AVCodecContext *CC = getCodecContext(it.key());
    23592368            bool backwardsPTS = false;
    23602369
     2370            // What to do if the CC is corrupt?
     2371            // Just wait and hope it repairs itself
     2372            // But if it won't repair itself it ends up in a 'Deadlock detected' error
     2373            if (CC->sample_rate == 0 || CC->frame_size == 0)
     2374            {
     2375                LOG(VB_FRAME, LOG_ERR, QString("CC corrupt in AUD-Frame #%1. sample_rate %2, frame_size %3, channels %4")
     2376                                .arg(it.key())
     2377                                .arg(CC->sample_rate)
     2378                                .arg(CC->frame_size)
     2379                                .arg(CC->channels));
     2380                continue;
     2381            }
     2382
    23612383            while (af->count())
    23622384            {
    2363                 // What to do if the CC is corrupt?
    2364                 // Just wait and hope it repairs itself
    2365                 if (CC->sample_rate == 0 || CC->frame_size == 0)
    2366                     break;
    23672385
    23682386                // The order of processing frames is critical to making
    23692387                // everything work.  Backwards PTS discrepancies complicate
     
    25422572    const struct option long_options[] =
    25432573        {
    25442574            {"infile", required_argument, NULL, 'i'},
    2545 
    25462575            {"outfile", required_argument, NULL, 'o'},
    25472576            {"format", required_argument, NULL, 'r'},
    25482577            {"dbg_lvl", required_argument, NULL, 'd'},