Ticket #2797: mythtv.diff

File mythtv.diff, 2.9 KB (added by anonymous, 5 years ago)

mythtv.diff

  • libs/libavformat/utils.c

     
    18661866/** 
    18671867 * @brief Read the beginning of a media file to get stream information. 
    18681868 * 
     1869 * This uses the helper function to determine the stream info quickly to 
     1870 * cut down channel change time. 
     1871 * 
     1872 * @param ic media file handle 
     1873 * @return >=0 if OK. AVERROR_xxx if error.   
     1874 */ 
     1875int av_find_stream_info(AVFormatContext *ic) 
     1876{ 
     1877    return av_find_stream_info_helper(ic, 0); 
     1878} 
     1879 
     1880/** 
     1881 * @brief Read the beginning of a media file to get stream information. 
     1882 * 
     1883 * This uses the helper function to determine the stream info in a thorough 
     1884 * fashion so that we don't miss any streams. 
     1885 * 
     1886 * @param ic media file handle 
     1887 * @return >=0 if OK. AVERROR_xxx if error.   
     1888 */ 
     1889int av_find_stream_info_deep(AVFormatContext *ic) 
     1890{ 
     1891    return av_find_stream_info_helper(ic, 1); 
     1892} 
     1893 
     1894/** 
     1895 * @brief Read the beginning of a media file to get stream information. 
     1896 * 
    18691897 * This is useful for file formats with no headers such as MPEG. This 
    18701898 * function also computes the real frame rate in case of mpeg2 repeat 
    18711899 * frame mode. 
    18721900 * 
     1901 * If we specify a deep search, it will take longer to do (not good for 
     1902 * channel changes) but will pick up all stream info (good for mytharchive). 
     1903 * 
    18731904 * @param ic media file handle 
     1905 * @param deepsearch flag to indicate whether the search is fast (0) or thorough (1) 
    18741906 * @return >=0 if OK. AVERROR_xxx if error.   
    18751907 * @todo let user decide somehow what information is needed so we dont waste time geting stuff the user doesnt need 
    18761908 */ 
    1877 int av_find_stream_info(AVFormatContext *ic) 
     1909int av_find_stream_info_helper(AVFormatContext *ic, int deepsearch) 
    18781910{ 
    18791911    int i, count, ret, read_size, j, read_packets = 0; 
    18801912    AVStream *st; 
     
    19371969               stop here */ 
    19381970            if (!(ic->ctx_flags & AVFMTCTX_NOHEADER) || 
    19391971                (read_size >= MAX_READ_SIZE || read_packets >= MAX_FRAMES) || 
    1940                 (hasvideo && hasaudio)) { 
     1972                (hasvideo && hasaudio && (deepsearch == 0))) { 
    19411973                /* if we found the info for all the codecs, we can stop */ 
    19421974                ret = count; 
    19431975                break; 
  • libs/libavformat/avformat.h

     
    476476#define AVERROR_NOTSUPP     (-7)  /* operation not supported */ 
    477477 
    478478int av_find_stream_info(AVFormatContext *ic); 
     479int av_find_stream_info_deep(AVFormatContext *ic); 
     480int av_find_stream_info_helper(AVFormatContext *ic, int deepsearch); 
    479481int av_read_packet(AVFormatContext *s, AVPacket *pkt); 
    480482int av_read_frame(AVFormatContext *s, AVPacket *pkt); 
    481483int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags);