summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-06-05 23:34:17 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-06-05 23:35:42 +0300
commitdde8b753e417bb44e5f18ac9d6901deb95bf6ab0 (patch)
tree84fc2a73fc1f514417cacd61c9a57580ca47cd66 /libmpdemux
parent331167ae132d35c821510307d8dd109ce27bfc1b (diff)
parent09bca6575f66394e1f4ba3845330d21d30895f3d (diff)
downloadmpv-dde8b753e417bb44e5f18ac9d6901deb95bf6ab0.tar.bz2
mpv-dde8b753e417bb44e5f18ac9d6901deb95bf6ab0.tar.xz
Merge svn changes r31318 to r31328
r31328 is a somewhat questionable (changing the option at that point isn't quite safe), but it was a failure case already...
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_lavf.c7
-rw-r--r--libmpdemux/demux_ts.c10
2 files changed, 11 insertions, 6 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 497ff563bf..ec8075d219 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -80,11 +80,10 @@ static int mp_read(void *opaque, uint8_t *buf, int size) {
struct stream *stream = demuxer->stream;
int ret;
- if(stream_eof(stream)) //needed?
- return -1;
ret=stream_read(stream, buf, size);
- mp_msg(MSGT_HEADER,MSGL_DBG2,"%d=mp_read(%p, %p, %d), eof:%d\n", ret, stream, buf, size, stream->eof);
+ mp_msg(MSGT_HEADER,MSGL_DBG2,"%d=mp_read(%p, %p, %d), pos: %"PRId64", eof:%d\n",
+ ret, stream, buf, size, stream_tell(stream), stream->eof);
return ret;
}
@@ -106,8 +105,6 @@ static int64_t mp_seek(void *opaque, int64_t pos, int whence) {
if(pos<0)
return -1;
- if(pos<stream->end_pos && stream->eof)
- stream_reset(stream);
current_pos = stream_tell(stream);
if(stream_seek(stream, pos)==0) {
stream_reset(stream);
diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c
index 697c7e7b9b..e33791fb89 100644
--- a/libmpdemux/demux_ts.c
+++ b/libmpdemux/demux_ts.c
@@ -69,6 +69,7 @@ typedef enum
VIDEO_MPEG4 = 0x10000004,
VIDEO_H264 = 0x10000005,
VIDEO_AVC = mmioFOURCC('a', 'v', 'c', '1'),
+ VIDEO_DIRAC = mmioFOURCC('d', 'r', 'a', 'c'),
VIDEO_VC1 = mmioFOURCC('W', 'V', 'C', '1'),
AUDIO_MP2 = 0x50,
AUDIO_A52 = 0x2000,
@@ -245,7 +246,7 @@ typedef struct {
#define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS) || ((x) == AUDIO_TRUEHD))
-#define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC) || ((x) == VIDEO_VC1))
+#define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC) || ((x) == VIDEO_DIRAC) || ((x) == VIDEO_VC1))
#define IS_SUB(x) (((x) == SPU_DVD) || ((x) == SPU_DVB) || ((x) == SPU_TELETEXT))
static int ts_parse(demuxer_t *demuxer, ES_stream_t *es, unsigned char *packet, int probe);
@@ -2326,6 +2327,10 @@ static int parse_descriptors(struct pmt_es_t *es, uint8_t *ptr)
{
es->type = VIDEO_VC1;
}
+ else if(d[0] == 'd' && d[1] == 'r' && d[2] == 'a' && d[3] == 'c')
+ {
+ es->type = VIDEO_DIRAC;
+ }
else
es->type = UNKNOWN;
mp_msg(MSGT_DEMUX, MSGL_DBG2, "FORMAT %s\n", es->format_descriptor);
@@ -2523,6 +2528,9 @@ static int parse_pmt(ts_priv_t * priv, uint16_t progid, uint16_t pid, int is_sta
case 0x86:
pmt->es[idx].type = AUDIO_DTS;
break;
+ case 0xD1:
+ pmt->es[idx].type = VIDEO_DIRAC;
+ break;
case 0xEA:
pmt->es[idx].type = VIDEO_VC1;
break;