summaryrefslogtreecommitdiff
path: root/libavformat/cdg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-24 02:08:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-24 03:32:24 +0100
commit8e576d58306df95d6373dd0ca2c1f21f1afaeca9 (patch)
tree5f7b9c8783b342e80e32b58b94ded819eb414b3c /libavformat/cdg.c
parent7ffa9ea05aa951b6b13e615f1bd3b8280f758561 (diff)
parentbbb46f3ec7128d8a624f2aa5b4f99ec44c0b9567 (diff)
downloadffmpeg-8e576d58306df95d6373dd0ca2c1f21f1afaeca9.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: libavutil: add utility functions to simplify allocation of audio buffers. libavutil: add planar sample formats and av_sample_fmt_is_planar() avconv: fix segfault at EOF with delayed pictures pcmdec: remove unneeded resetting of samples pointer avconv: remove a now unused parameter from output_packet(). avconv: formatting fixes in output_packet() avconv: declare some variables in blocks where they are used avconv: use the same behavior when decoding audio/video/subs bethsoftvideo: return proper consumed size for palette packets. cdg: skip packets that don't contain a cdg command. crcenc: add flags avconv: use vsync 0 for AVFMT_NOTIMESTAMPS formats. tiffenc: add a private option for selecting compression algorithm md5enc: add flags ARM: remove needless .text/.align directives Conflicts: doc/APIchanges libavcodec/tiffenc.c libavutil/avutil.h libavutil/samplefmt.c libavutil/samplefmt.h tests/ref/fate/bethsoft-vid tests/ref/fate/cdgraphics tests/ref/fate/film-cvid-pcm-stereo-8bit tests/ref/fate/mpeg2-field-enc tests/ref/fate/nuv tests/ref/fate/tiertex-seq tests/ref/fate/tscc-32bit tests/ref/fate/vmnc-32bit Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/cdg.c')
-rw-r--r--libavformat/cdg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/cdg.c b/libavformat/cdg.c
index 75f1fb24c9..444c1fa27a 100644
--- a/libavformat/cdg.c
+++ b/libavformat/cdg.c
@@ -22,6 +22,8 @@
#include "avformat.h"
#define CDG_PACKET_SIZE 24
+#define CDG_COMMAND 0x09
+#define CDG_MASK 0x3F
static int read_header(AVFormatContext *s, AVFormatParameters *ap)
{
@@ -49,7 +51,12 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret;
- ret = av_get_packet(s->pb, pkt, CDG_PACKET_SIZE);
+ while (1) {
+ ret = av_get_packet(s->pb, pkt, CDG_PACKET_SIZE);
+ if (ret < 1 || (pkt->data[0] & CDG_MASK) == CDG_COMMAND)
+ break;
+ av_free_packet(pkt);
+ }
pkt->stream_index = 0;
pkt->dts=pkt->pts= s->streams[0]->cur_dts;