annotate stream/stream_mf.c @ 36551:a5764687ff8d

mf: Fix initial hang/delay with mf:// The mf:// type is not actually a stream, so do not try to cache its output. Otherwise the read failures will be interpreted as connection errors and our retry routine kicks in, this causing the delay.
author reimar
date Sun, 19 Jan 2014 18:42:42 +0000
parents 0f1b5b68af32
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
1 /*
26737
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
2 * stream layer for multiple files input, based on previous work from Albeu
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
3 *
26737
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
4 * Copyright (C) 2006 Benjamin Zores
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
5 *
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
6 * This file is part of MPlayer.
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
7 *
26737
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
8 * MPlayer is free software; you can redistribute it and/or modify
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
9 * it under the terms of the GNU General Public License as published by
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
11 * (at your option) any later version.
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
12 *
26737
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
13 * MPlayer is distributed in the hope that it will be useful,
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
16 * GNU General Public License for more details.
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
17 *
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
18 * You should have received a copy of the GNU General Public License along
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
19 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 25211
diff changeset
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
21 */
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
22
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
23 #include "config.h"
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
24
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
25 #include <stdlib.h>
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
26 #include <string.h>
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
27
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
28 #include "stream.h"
19312
ab8d6b6deb63 proper inclusion of demuxer.h (including libmpdemux in Makefile only was to make previous split easier)
ben
parents: 19301
diff changeset
29 #include "libmpdemux/demuxer.h"
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
30
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
31 static int
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
32 mf_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
33 {
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
34 stream->type = STREAMTYPE_MF;
36551
a5764687ff8d mf: Fix initial hang/delay with mf://
reimar
parents: 29263
diff changeset
35 stream->flags = STREAM_NON_CACHEABLE;
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
36 *file_format = DEMUXER_TYPE_MF;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26737
diff changeset
37
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
38 return STREAM_OK;
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
39 }
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
40
25211
c1d17bd6683c Mark all stream_info_t as const
reimar
parents: 19312
diff changeset
41 const stream_info_t stream_info_mf = {
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
42 "Multiple files input",
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
43 "mf",
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
44 "Benjamin Zores, Albeu",
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
45 "",
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26737
diff changeset
46 mf_stream_open,
19301
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
47 { "mf", NULL },
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
48 NULL,
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
49 1
097e5bc71210 added dedicated file for mf:// input
ben
parents:
diff changeset
50 };