summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-07-01 16:18:21 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-07-01 16:18:21 +0300
commit7de350c673e1c0ae52d655e322a072f2f6b624b0 (patch)
tree346005084450b679f57c77daad2263fcdcf9e1de /libmpdemux
parent28fbfd2cdea5ffa860a251de274a74b0e85c88f0 (diff)
parent3ff9a6e7d82ff9a5231e561bd2686fab7df97f68 (diff)
downloadmpv-7de350c673e1c0ae52d655e322a072f2f6b624b0.tar.bz2
mpv-7de350c673e1c0ae52d655e322a072f2f6b624b0.tar.xz
Merge svn changes up to r27184
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_asf.c9
-rw-r--r--libmpdemux/demux_audio.c1
-rw-r--r--libmpdemux/demux_mov.c9
-rw-r--r--libmpdemux/extension.c1
-rw-r--r--libmpdemux/mp_taglists.c2
5 files changed, 14 insertions, 8 deletions
diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c
index 7d5a164886..65741d3ab7 100644
--- a/libmpdemux/demux_asf.c
+++ b/libmpdemux/demux_asf.c
@@ -3,7 +3,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <assert.h>
#include "config.h"
#include "mp_msg.h"
@@ -501,8 +500,9 @@ static int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds){
int len2=p[0];
p++;
//printf(" group part: %d bytes\n",len2);
- if(len2 > len - 1) break; // Not enough data
- assert(len2 > 0 && len2 <= asf->packetsize);
+ if(len2 > len - 1 || len2 < 0) break; // Not enough data
+ if(len2 == 0) continue;
+ len2 = FFMIN(len2, asf->packetsize);
demux_asf_read_packet(demux,p,len2,streamno,seq,x,duration,-1,keyframe);
p+=len2;
len-=len2+1;
@@ -515,8 +515,9 @@ static int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds){
default:
// NO GROUPING:
//printf("fragment offset: %d \n",sh->x);
+ if (len <= 0) break;
if (!asf->asf_is_dvr_ms || asf->found_first_key_frame) {
- assert(len > 0 && len <= asf->packetsize);
+ len = FFMIN(len, asf->packetsize);
demux_asf_read_packet(demux,p,len,streamno,seq,time2,duration,x,keyframe);
}
p+=len;
diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c
index d1717c791e..269fa23539 100644
--- a/libmpdemux/demux_audio.c
+++ b/libmpdemux/demux_audio.c
@@ -423,6 +423,7 @@ static int demux_audio_open(demuxer_t* demuxer) {
if((w->wFormatTag == 0x01) && (w->nChannels == 2) && (w->nSamplesPerSec == 44100)) {
unsigned char buf[16384]; // vlc uses 16384*4 (4 dts frames)
unsigned int i;
+ memset(buf, 0, sizeof(buf));
stream_read(s, buf, sizeof(buf));
for (i = 0; i < sizeof(buf) - 5; i += 2) {
// DTS, 14 bit, LE
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index edfe7cd221..37de8b9558 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -928,10 +928,6 @@ static int gen_sh_video(sh_video_t* sh, mov_track_t* trak, int timescale) {
int hdr_ptr = 76; // the byte just after depth
unsigned char *palette_map;
- depth = trak->stdata[75] | (trak->stdata[74] << 8);
- if (trak->fourcc == mmioFOURCC('r', 'a', 'w', ' ')) {
- sh->format = IMGFMT_RGB | depth;
- } else
sh->format=trak->fourcc;
// crude video delay from editlist0 hack ::atm
@@ -949,6 +945,11 @@ static int gen_sh_video(sh_video_t* sh, mov_track_t* trak, int timescale) {
trak->stdata_len);
return 0;
}
+
+ depth = trak->stdata[75] | (trak->stdata[74] << 8);
+ if (trak->fourcc == mmioFOURCC('r', 'a', 'w', ' '))
+ sh->format = IMGFMT_RGB | depth;
+
// stdata[]:
// 8 short version
// 10 short revision
diff --git a/libmpdemux/extension.c b/libmpdemux/extension.c
index 87cc07cc25..5db36b6f29 100644
--- a/libmpdemux/extension.c
+++ b/libmpdemux/extension.c
@@ -62,6 +62,7 @@ static struct {
{ "ape", DEMUXER_TYPE_LAVF },
{ "apl", DEMUXER_TYPE_LAVF },
{ "mac", DEMUXER_TYPE_LAVF },
+ { "str", DEMUXER_TYPE_LAVF },
// At least the following are hacks against broken autodetection
// that should not be there
diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c
index a620ef5649..4fcc95d6bd 100644
--- a/libmpdemux/mp_taglists.c
+++ b/libmpdemux/mp_taglists.c
@@ -27,6 +27,7 @@ static const AVCodecTag mp_wav_tags[] = {
{ CODEC_ID_ADPCM_EA_MAXIS_XA, MKTAG('A', 'D', 'X', 'A')},
{ CODEC_ID_ADPCM_IMA_WS, MKTAG('A', 'I', 'W', 'S')},
{ CODEC_ID_ADPCM_THP, MKTAG('T', 'H', 'P', 'A')},
+ { CODEC_ID_ADPCM_XA, MKTAG('P', 'S', 'X', 'A')},
{ CODEC_ID_AMR_NB, MKTAG('n', 'b', 0, 0)},
{ CODEC_ID_COOK, MKTAG('c', 'o', 'o', 'k')},
{ CODEC_ID_DSICINAUDIO, MKTAG('D', 'C', 'I', 'A')},
@@ -69,6 +70,7 @@ static const AVCodecTag mp_bmp_tags[] = {
{ CODEC_ID_FLIC, MKTAG('F', 'L', 'I', 'C')},
{ CODEC_ID_IDCIN, MKTAG('I', 'D', 'C', 'I')},
{ CODEC_ID_INTERPLAY_VIDEO, MKTAG('I', 'N', 'P', 'V')},
+ { CODEC_ID_MDEC, MKTAG('M', 'D', 'E', 'C')},
{ CODEC_ID_RL2, MKTAG('R', 'L', '2', 'V')},
{ CODEC_ID_ROQ, MKTAG('R', 'o', 'Q', 'V')},
{ CODEC_ID_THP, MKTAG('T', 'H', 'P', 'V')},