Ticket #2335: 2335_fix_2.diff

File 2335_fix_2.diff, 2.2 KB (added by Shane Shrybman <gnome42@…>, 18 years ago)

Updated patch. Please test with non-livetv files

  • libs/libmythtv/avformatdecoder.cpp

     
    713714{
    714715    readcontext.prot = &AVF_RingBuffer_Protocol;
    715716    readcontext.flags = 0;
    716     readcontext.is_streamed = 0;
     717    if (ringBuffer->LiveMode() || recordingHasPositionMap)
     718        readcontext.is_streamed = 1;
     719    else
     720        readcontext.is_streamed = 0;
    717721    readcontext.max_packet_size = 0;
    718722    readcontext.priv_data = avfRingBuffer;
    719723
     
    733737    ic->pb.pos = 0;
    734738    ic->pb.must_flush = 0;
    735739    ic->pb.eof_reached = 0;
    736     if (ringBuffer->isDVD())
     740    if (ringBuffer->isDVD() || ringBuffer->LiveMode() ||
     741        recordingHasPositionMap)
    737742        ic->pb.is_streamed = 1;
    738     else 
     743    else
    739744        ic->pb.is_streamed = 0;
    740745    ic->pb.max_packet_size = 0;
    741746}
     
    802807        return -1;
    803808    }
    804809
     810    // Try to get a position map from the recorder if we don't have one yet.
     811    // We need to do this before InitByteContext() because we enable
     812    // is_streamed based on the presence of a posmap.
     813    if (!recordingHasPositionMap)
     814    {
     815        if ((m_playbackinfo) || livetv || watchingrecording)
     816        {
     817            recordingHasPositionMap |= SyncPositionMap();
     818            if (recordingHasPositionMap && !livetv && !watchingrecording)
     819            {
     820                hasFullPositionMap = true;
     821                gopset = true;
     822            }
     823        }
     824    }
     825
    805826    InitByteContext();
    806827
    807828    int err = av_open_input_file(&ic, filename, fmt, 0, &params);
     
    863884            SetVideoByComponentTag(initialVideo);
    864885    }
    865886
    866     // Try to get a position map from the recorder if we don't have one yet.
    867     if (!recordingHasPositionMap)
    868     {
    869         if ((m_playbackinfo) || livetv || watchingrecording)
    870         {
    871             recordingHasPositionMap |= SyncPositionMap();
    872             if (recordingHasPositionMap && !livetv && !watchingrecording)
    873             {
    874                 hasFullPositionMap = true;
    875                 gopset = true;
    876             }
    877         }
    878     }
    879 
    880887    // If we don't have a position map, set up ffmpeg for seeking
    881888    if (!recordingHasPositionMap)
    882889    {