mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 13:14:36 +00:00
Simplify code: make open_stream() accept NULL file_format argument
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31952 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
fb46c7bdbe
commit
a62d145bdf
2
ass_mp.c
2
ass_mp.c
@ -239,7 +239,7 @@ ASS_Track *ass_read_stream(ASS_Library *library, const char *fname, char *charse
|
||||
size_t buf_alloc = 0;
|
||||
stream_t *fd;
|
||||
|
||||
fd = open_stream(fname, NULL, &i);
|
||||
fd = open_stream(fname, NULL, NULL);
|
||||
if (!fd)
|
||||
// Stream code should have printed an error already
|
||||
return NULL;
|
||||
|
@ -667,7 +667,7 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){
|
||||
|
||||
|
||||
if (frameno_filename) {
|
||||
stream2=open_stream(frameno_filename,0,&i);
|
||||
stream2=open_stream(frameno_filename, NULL, NULL);
|
||||
if(stream2){
|
||||
demuxer2=demux_open(&opts, stream2,DEMUXER_TYPE_AVI,-1,-1,-2,NULL);
|
||||
if(demuxer2) mp_tmsg(MSGT_MENCODER, MSGL_INFO, "Using pass3 control file: %s\n", frameno_filename);
|
||||
|
@ -47,6 +47,8 @@ int dvd_title=0;
|
||||
stream_t* open_stream(const char *filename, struct MPOpts *options,
|
||||
int *file_format)
|
||||
{
|
||||
if (!file_format)
|
||||
file_format = &(int){DEMUXER_TYPE_UNKNOWN};
|
||||
// Check if playlist or unknown
|
||||
if (*file_format != DEMUXER_TYPE_PLAYLIST){
|
||||
*file_format=DEMUXER_TYPE_UNKNOWN;
|
||||
|
@ -1382,8 +1382,7 @@ sub_data* sub_read_file (char *filename, float fps) {
|
||||
const struct subreader *srp;
|
||||
|
||||
if(filename==NULL) return NULL; //qnx segfault
|
||||
i = 0;
|
||||
fd=open_stream (filename, NULL, &i); if (!fd) return NULL;
|
||||
fd=open_stream (filename, NULL, NULL); if (!fd) return NULL;
|
||||
|
||||
sub_format = SUB_INVALID;
|
||||
for (utf16 = 0; sub_format == SUB_INVALID && utf16 < 3; utf16++) {
|
||||
|
Loading…
Reference in New Issue
Block a user