Ticket #2797: mythtv.diff
| File mythtv.diff, 2.9 KB (added by , 19 years ago) |
|---|
-
libs/libavformat/utils.c
1866 1866 /** 1867 1867 * @brief Read the beginning of a media file to get stream information. 1868 1868 * 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 */ 1875 int 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 */ 1889 int 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 * 1869 1897 * This is useful for file formats with no headers such as MPEG. This 1870 1898 * function also computes the real frame rate in case of mpeg2 repeat 1871 1899 * frame mode. 1872 1900 * 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 * 1873 1904 * @param ic media file handle 1905 * @param deepsearch flag to indicate whether the search is fast (0) or thorough (1) 1874 1906 * @return >=0 if OK. AVERROR_xxx if error. 1875 1907 * @todo let user decide somehow what information is needed so we dont waste time geting stuff the user doesnt need 1876 1908 */ 1877 int av_find_stream_info (AVFormatContext *ic)1909 int av_find_stream_info_helper(AVFormatContext *ic, int deepsearch) 1878 1910 { 1879 1911 int i, count, ret, read_size, j, read_packets = 0; 1880 1912 AVStream *st; … … 1937 1969 stop here */ 1938 1970 if (!(ic->ctx_flags & AVFMTCTX_NOHEADER) || 1939 1971 (read_size >= MAX_READ_SIZE || read_packets >= MAX_FRAMES) || 1940 (hasvideo && hasaudio )) {1972 (hasvideo && hasaudio && (deepsearch == 0))) { 1941 1973 /* if we found the info for all the codecs, we can stop */ 1942 1974 ret = count; 1943 1975 break; -
libs/libavformat/avformat.h
476 476 #define AVERROR_NOTSUPP (-7) /* operation not supported */ 477 477 478 478 int av_find_stream_info(AVFormatContext *ic); 479 int av_find_stream_info_deep(AVFormatContext *ic); 480 int av_find_stream_info_helper(AVFormatContext *ic, int deepsearch); 479 481 int av_read_packet(AVFormatContext *s, AVPacket *pkt); 480 482 int av_read_frame(AVFormatContext *s, AVPacket *pkt); 481 483 int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags);
