Mercurial > libavformat.hg
comparison rtsp.c @ 5328:2f2a94b37543 libavformat
Remove ancient redir demuxer.
HTTP supports redirection just fine without it.
author | diego |
---|---|
date | Sat, 24 Oct 2009 12:44:27 +0000 |
parents | 3fab66935e56 |
children | 1ab113d6c45b |
comparison
equal
deleted
inserted
replaced
5327:a8e26981c104 | 5328:2f2a94b37543 |
---|---|
1775 sdp_read_header, | 1775 sdp_read_header, |
1776 sdp_read_packet, | 1776 sdp_read_packet, |
1777 sdp_read_close, | 1777 sdp_read_close, |
1778 }; | 1778 }; |
1779 #endif | 1779 #endif |
1780 | |
1781 #if CONFIG_REDIR_DEMUXER | |
1782 /* dummy redirector format (used directly in av_open_input_file now) */ | |
1783 static int redir_probe(AVProbeData *pd) | |
1784 { | |
1785 const char *p; | |
1786 p = pd->buf; | |
1787 skip_spaces(&p); | |
1788 if (av_strstart(p, "http://", NULL) || | |
1789 av_strstart(p, "rtsp://", NULL)) | |
1790 return AVPROBE_SCORE_MAX; | |
1791 return 0; | |
1792 } | |
1793 | |
1794 static int redir_read_header(AVFormatContext *s, AVFormatParameters *ap) | |
1795 { | |
1796 char buf[4096], *q; | |
1797 int c; | |
1798 AVFormatContext *ic = NULL; | |
1799 ByteIOContext *f = s->pb; | |
1800 | |
1801 /* parse each URL and try to open it */ | |
1802 c = url_fgetc(f); | |
1803 while (c != URL_EOF) { | |
1804 /* skip spaces */ | |
1805 for(;;) { | |
1806 if (!redir_isspace(c)) | |
1807 break; | |
1808 c = url_fgetc(f); | |
1809 } | |
1810 if (c == URL_EOF) | |
1811 break; | |
1812 /* record url */ | |
1813 q = buf; | |
1814 for(;;) { | |
1815 if (c == URL_EOF || redir_isspace(c)) | |
1816 break; | |
1817 if ((q - buf) < sizeof(buf) - 1) | |
1818 *q++ = c; | |
1819 c = url_fgetc(f); | |
1820 } | |
1821 *q = '\0'; | |
1822 //printf("URL='%s'\n", buf); | |
1823 /* try to open the media file */ | |
1824 if (av_open_input_file(&ic, buf, NULL, 0, NULL) == 0) | |
1825 break; | |
1826 } | |
1827 if (!ic) | |
1828 return AVERROR(EIO); | |
1829 | |
1830 *s = *ic; | |
1831 url_fclose(f); | |
1832 | |
1833 return 0; | |
1834 } | |
1835 | |
1836 AVInputFormat redir_demuxer = { | |
1837 "redir", | |
1838 NULL_IF_CONFIG_SMALL("Redirector format"), | |
1839 0, | |
1840 redir_probe, | |
1841 redir_read_header, | |
1842 NULL, | |
1843 NULL, | |
1844 }; | |
1845 #endif |