summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demuxer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/demuxer.c')
-rw-r--r--libmpdemux/demuxer.c38
1 files changed, 9 insertions, 29 deletions
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index f8309b9f49..ea8c4e01f1 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -187,7 +187,7 @@ static struct demux_packet *create_packet(size_t len)
dp->duration = -1;
dp->stream_pts = MP_NOPTS_VALUE;
dp->pos = 0;
- dp->flags = 0;
+ dp->keyframe = false;
dp->refcount = 1;
dp->master = NULL;
dp->buffer = NULL;
@@ -601,14 +601,14 @@ void ds_clear_parser(demux_stream_t *ds)
}
void ds_read_packet(demux_stream_t *ds, stream_t *stream, int len,
- double pts, off_t pos, int flags)
+ double pts, off_t pos, bool keyframe)
{
demux_packet_t *dp = new_demux_packet(len);
len = stream_read(stream, dp->buffer, len);
resize_demux_packet(dp, len);
dp->pts = pts;
dp->pos = pos;
- dp->flags = flags;
+ dp->keyframe = keyframe;
// append packet to DS stream:
ds_add_packet(ds, dp);
}
@@ -652,7 +652,7 @@ int ds_fill_buffer(demux_stream_t *ds)
ds->pts_bytes += p->len; // !!!
if (p->stream_pts != MP_NOPTS_VALUE)
demux->stream_pts = p->stream_pts;
- ds->flags = p->flags;
+ ds->keyframe = p->keyframe;
// unlink packet:
ds->bytes -= p->len;
ds->current = p;
@@ -1000,11 +1000,8 @@ static struct demuxer *demux_open_stream(struct MPOpts *opts,
if (!desc)
// should only happen with obsolete -demuxer 99 numeric format
return NULL;
- demuxer = open_given_type(opts, desc, stream, force, audio_id,
- video_id, sub_id, filename, params);
- if (demuxer)
- goto dmx_open;
- return NULL;
+ return open_given_type(opts, desc, stream, force, audio_id,
+ video_id, sub_id, filename, params);
}
// Test demuxers with safe file checks
@@ -1013,7 +1010,7 @@ static struct demuxer *demux_open_stream(struct MPOpts *opts,
demuxer = open_given_type(opts, desc, stream, false, audio_id,
video_id, sub_id, filename, params);
if (demuxer)
- goto dmx_open;
+ return demuxer;
}
}
@@ -1026,7 +1023,7 @@ static struct demuxer *demux_open_stream(struct MPOpts *opts,
demuxer = open_given_type(opts, desc, stream, false, audio_id,
video_id, sub_id, filename, params);
if (demuxer)
- goto dmx_open;
+ return demuxer;
}
// Finally try detection for demuxers with unsafe checks
@@ -1035,28 +1032,11 @@ static struct demuxer *demux_open_stream(struct MPOpts *opts,
demuxer = open_given_type(opts, desc, stream, false, audio_id,
video_id, sub_id, filename, params);
if (demuxer)
- goto dmx_open;
+ return demuxer;
}
}
return NULL;
-
- dmx_open:
-
- if (demuxer->type == DEMUXER_TYPE_PLAYLIST)
- return demuxer;
-
- struct sh_video *sh_video = demuxer->video->sh;
- if (sh_video && sh_video->bih) {
- int biComp = le2me_32(sh_video->bih->biCompression);
- mp_msg(MSGT_DEMUX, MSGL_INFO,
- "VIDEO: [%.4s] %dx%d %dbpp %5.3f fps %5.1f kbps (%4.1f kbyte/s)\n",
- (char *) &biComp, sh_video->bih->biWidth,
- sh_video->bih->biHeight, sh_video->bih->biBitCount,
- sh_video->fps, sh_video->i_bps * 0.008f,
- sh_video->i_bps / 1024.0f);
- }
- return demuxer;
}
struct demuxer *demux_open(struct MPOpts *opts, stream_t *vs, int file_format,