summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demuxer.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-07-28 17:07:49 +0200
committerwm4 <wm4@mplayer2.org>2012-07-28 17:24:05 +0200
commit51e198c2a1e43b74ad35ef358628dcd8791158d9 (patch)
tree60f6c2255ed912a7a4866b71728104a2cb2442f1 /libmpdemux/demuxer.c
parent2793e7eb70a342b346788f83e1ed660c8e0d491e (diff)
parent7dfaaa95104a8e6dc024fddaf1b49c71768f1be7 (diff)
downloadmpv-51e198c2a1e43b74ad35ef358628dcd8791158d9.tar.bz2
mpv-51e198c2a1e43b74ad35ef358628dcd8791158d9.tar.xz
Merge remote-tracking branch 'origin/master'
Conflicts: .gitignore bstr.c cfg-mplayer.h defaultopts.c libvo/video_out.c The conflict in bstr.c is due to uau adding a bstr_getline function in commit 2ba8b91a97e7e8. This function already existed in this branch. While uau's function is obviously derived from mine, it's incompatible. His function preserves line breaks, while mine strips them. Add a bstr_strip_linebreaks function, fix all other uses of bstr_getline, and pick uau's implementation. In .gitignore, change vo_gl3_shaders.h to use an absolute path additional to resolving the merge conflict.
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,