Ticket #2335: 2335_fix_3.diff

File 2335_fix_3.diff, 2.3 KB (added by Janne Grunau, 18 years ago)

updated fix. set is_streamed only for DVD and LiveTV with posmap. DVB cards need #3963 to be fixed

  • libs/libmythtv/avformatdecoder.cpp

     
    745745
    746746void AvFormatDecoder::InitByteContext(void)
    747747{
     748    int streamed = 0;
     749    if (ringBuffer->isDVD() || (ringBuffer->LiveMode() && recordingHasPositionMap))
     750        streamed = 1;
     751
    748752    readcontext.prot = &AVF_RingBuffer_Protocol;
    749753    readcontext.flags = 0;
    750     readcontext.is_streamed = 0;
     754    readcontext.is_streamed = streamed;
    751755    readcontext.max_packet_size = 0;
    752756    readcontext.priv_data = avfRingBuffer;
    753757
     
    767771    ic->pb.pos = 0;
    768772    ic->pb.must_flush = 0;
    769773    ic->pb.eof_reached = 0;
    770     if (ringBuffer->isDVD())
    771         ic->pb.is_streamed = 1;
    772     else
    773         ic->pb.is_streamed = 0;
     774    ic->pb.is_streamed = streamed;
    774775    ic->pb.max_packet_size = 0;
    775776}
    776777
     
    836837        return -1;
    837838    }
    838839
     840    // Try to get a position map from the recorder if we don't have one yet.
     841    // We need to do this before InitByteContext() because we enable
     842    // is_streamed based on the presence of a posmap.
     843    if (!recordingHasPositionMap)
     844    {
     845        if ((m_playbackinfo) || livetv || watchingrecording)
     846        {
     847            recordingHasPositionMap |= SyncPositionMap();
     848            if (recordingHasPositionMap && !livetv && !watchingrecording)
     849            {
     850                hasFullPositionMap = true;
     851                gopset = true;
     852            }
     853        }
     854    }
     855
    839856    InitByteContext();
    840857
    841858    int err = av_open_input_file(&ic, filename, fmt, 0, &params);
     
    897914            SetVideoByComponentTag(initialVideo);
    898915    }
    899916
    900     // Try to get a position map from the recorder if we don't have one yet.
    901     if (!recordingHasPositionMap)
    902     {
    903         if ((m_playbackinfo) || livetv || watchingrecording)
    904         {
    905             recordingHasPositionMap |= SyncPositionMap();
    906             if (recordingHasPositionMap && !livetv && !watchingrecording)
    907             {
    908                 hasFullPositionMap = true;
    909                 gopset = true;
    910             }
    911         }
    912     }
    913 
    914917    // If we don't have a position map, set up ffmpeg for seeking
    915918    if (!recordingHasPositionMap)
    916919    {