diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-09-02 15:58:43 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-09-02 15:58:43 +0000 |
commit | da0b94f539a2dab7e150a419fa90b4d0d6ff9b84 (patch) | |
tree | 279cf99f5dda75c8caf5bf039a46505ad6e56dd8 /libavformat | |
parent | becc0ef95b2a6dc7c4127f5cd14ca948f980ac45 (diff) | |
download | ffmpeg-da0b94f539a2dab7e150a419fa90b4d0d6ff9b84.tar.gz |
workaround ms (lack of) intelligence in their design of dvr-ms
yes kids you do not make 90% of your file contain empty dummy packets
closes issue76
Originally committed as revision 10280 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/asf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c index 4aa98f6fa2..9cebd4c3da 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -826,6 +826,19 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) asf_st->frag_offset += asf->packet_frag_size; /* test if whole packet is read */ if (asf_st->frag_offset == asf_st->pkt.size) { + //workaround for macroshit radio DVR-MS files + if( s->streams[asf->stream_index]->codec->codec_id == CODEC_ID_MPEG2VIDEO + && asf_st->pkt.size > 100){ + int i; + for(i=0; i<asf_st->pkt.size && !asf_st->pkt.data[i]; i++); + if(i == asf_st->pkt.size){ + av_log(s, AV_LOG_DEBUG, "discarding ms fart\n"); + asf_st->frag_offset = 0; + av_free_packet(&asf_st->pkt); + continue; + } + } + /* return packet */ if (asf_st->ds_span > 1) { if(asf_st->pkt.size != asf_st->ds_packet_size * asf_st->ds_span){ |