summaryrefslogtreecommitdiff
path: root/src/demuxers
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers')
-rw-r--r--src/demuxers/demux_ac3.c4
-rw-r--r--src/demuxers/demux_dts.c6
-rw-r--r--src/demuxers/demux_mpeg_pes.c25
-rw-r--r--src/demuxers/demux_qt.c12
4 files changed, 28 insertions, 19 deletions
diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c
index 7f3dadeb7..279da6336 100644
--- a/src/demuxers/demux_ac3.c
+++ b/src/demuxers/demux_ac3.c
@@ -135,10 +135,10 @@ static int open_ac3_file(demux_ac3_t *this) {
uint8_t *peak;
blocksize = this->input->get_blocksize(this->input);
- if (blocksize) {
+ if (blocksize && INPUT_IS_SEEKABLE(this->input)) {
this->input->seek(this->input, 0, SEEK_SET);
buf_element_t *buf = this->input->read_block(this->input,
- this->audio_fifo,
+ this->stream->audio_fifo,
blocksize);
this->input->seek(this->input, 0, SEEK_SET);
diff --git a/src/demuxers/demux_dts.c b/src/demuxers/demux_dts.c
index 7baeae377..a9541b6f7 100644
--- a/src/demuxers/demux_dts.c
+++ b/src/demuxers/demux_dts.c
@@ -85,10 +85,10 @@ static int open_dts_file(demux_dts_t *this) {
lprintf("open_dts_file\n");
blocksize = this->input->get_blocksize(this->input);
- if (blocksize) {
- this->input->seek(this->input, 0, SEEK_SET);
+ if (blocksize && INPUT_IS_SEEKABLE(this->input)) {
+ // this->input->seek(this->input, 0, SEEK_SET);
buf_element_t *buf = this->input->read_block(this->input,
- this->audio_fifo,
+ this->stream->audio_fifo,
blocksize);
this->input->seek(this->input, 0, SEEK_SET);
diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c
index c5769e3e3..fbfde4e60 100644
--- a/src/demuxers/demux_mpeg_pes.c
+++ b/src/demuxers/demux_mpeg_pes.c
@@ -1135,17 +1135,20 @@ static int32_t parse_video_stream(demux_mpeg_pes_t *this, uint8_t *p, buf_elemen
*/
if (this->mpeg12_h264_detected & 1) {
buf_type = BUF_VIDEO_H264;
- int nal_type_code = -1;
- if (payload_size >= 4 && p[2] == 0x01 && p[1] == 0x00 && p[0] == 0x00)
- nal_type_code = p[3] & 0x1f;
- if (nal_type_code == 9) { /* access unit delimiter */
- buf_element_t *b = this->video_fifo->buffer_pool_alloc (this->video_fifo);
- b->content = b->mem;
- b->size = 0;
- b->pts = 0;
- b->type = buf_type;
- b->decoder_flags = BUF_FLAG_FRAME_END;
- this->video_fifo->put (this->video_fifo, b);
+ /* omit sending BUF_FLAG_FRAME_END for the first AUD occurence */
+ if (this->mpeg12_h264_detected > 2) {
+ int nal_type_code = -1;
+ if (payload_size >= 4 && p[2] == 0x01 && p[1] == 0x00 && p[0] == 0x00)
+ nal_type_code = p[3] & 0x1f;
+ if (nal_type_code == 9) { /* access unit delimiter */
+ buf_element_t *b = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ b->content = b->mem;
+ b->size = 0;
+ b->pts = 0;
+ b->type = buf_type;
+ b->decoder_flags = BUF_FLAG_FRAME_END;
+ this->video_fifo->put (this->video_fifo, b);
+ }
}
}
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index f837a2272..0624dc673 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -918,9 +918,15 @@ static qt_error parse_trak_atom (qt_trak *trak,
trak->edit_list_table[j].media_time);
}
- } else if (current_atom == MDHD_ATOM)
- trak->timescale = BE_32(&trak_atom[i + 0x10]);
- else if (current_atom == STSD_ATOM) {
+ } else if (current_atom == MDHD_ATOM) {
+ int version;
+ debug_atom_load ("demux_qt: mdhd atom\n");
+
+ version = trak_atom[i+4];
+ if ( version > 1 ) continue; /* unsupported, undocumented */
+
+ trak->timescale = BE_32(&trak_atom[i + (version == 0 ? 0x10 : 0x18) ]);
+ } else if (current_atom == STSD_ATOM) {
debug_atom_load ("demux_qt: stsd atom\n");
#if DEBUG_ATOM_LOAD