1 /* 2 * This file is part of mpv. 3 * 4 * mpv is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * mpv is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with mpv. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #include "misc/bstr.h" 19 #include "stream/stream.h" 20 #include "demux.h" 21 try_open_file(struct demuxer * demux,enum demux_check check)22static int try_open_file(struct demuxer *demux, enum demux_check check) 23 { 24 if (!bstr_startswith0(bstr0(demux->filename), "null://") && 25 check != DEMUX_CHECK_REQUEST) 26 return -1; 27 demux->seekable = true; 28 return 0; 29 } 30 31 const struct demuxer_desc demuxer_desc_null = { 32 .name = "null", 33 .desc = "null demuxer", 34 .open = try_open_file, 35 }; 36