summaryrefslogtreecommitdiff
path: root/libavformat/asfdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-07 22:41:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-07 22:41:37 +0200
commit6101e5322f083a806fd92a6261ff3197fdd0f5e7 (patch)
tree8b869bff6c1db61b3aa3bbabcbe322fee9f3dcf0 /libavformat/asfdec.c
parent5012c07336eff0e928afb57c6d38271e316c0a6c (diff)
parentd293e3464db647e72fffad50a678eca89546b65f (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtpdec_asf: Set the no_resync_search option for the chained asf demuxer asfdec: Add an option for not searching for the packet markers cosmetics: Clean up the tiffenc pix_fmts declaration to match the style of others cosmetics: Align codec declarations cosmetics: Convert mimic.c to utf-8 avconv: remove an unused function parameter. avconv: remove now pointless variables. avconv: drop support for building without libavfilter. nellymoserenc: fix crash due to memsetting the wrong area. libavformat: Only require first packet to be known for audio/video streams avplay: Don't try to scale timestamps if the tb isn't set Conflicts: Changelog configure ffmpeg.c libavcodec/aacenc.c libavcodec/bmpenc.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/ffv1.c libavcodec/flacenc.c libavcodec/fraps.c libavcodec/huffyuv.c libavcodec/libopenjpegdec.c libavcodec/mpeg12enc.c libavcodec/mpeg4videodec.c libavcodec/pamenc.c libavcodec/pgssubdec.c libavcodec/pngenc.c libavcodec/qtrleenc.c libavcodec/rawdec.c libavcodec/sgienc.c libavcodec/tiffenc.c libavcodec/v210dec.c libavcodec/wmv2dec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/asfdec.c')
-rw-r--r--libavformat/asfdec.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index d09f3882c6..6bcfe0ac34 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -26,6 +26,7 @@
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/mathematics.h"
+#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
@@ -35,6 +36,7 @@
#include "avlanguage.h"
typedef struct {
+ const AVClass *class;
int asfid2avid[128]; ///< conversion table from asf ID 2 AVStream ID
ASFStream streams[128]; ///< it's max number and it's not that big
uint32_t stream_bitrates[128]; ///< max number of streams, bitrate for each (for streaming)
@@ -72,8 +74,22 @@ typedef struct {
int stream_index;
ASFStream* asf_st; ///< currently decoded stream
+
+ int no_resync_search;
} ASFContext;
+static const AVOption options[] = {
+ {"no_resync_search", "Don't try to resynchronize by looking for a certain optional start code", offsetof(ASFContext, no_resync_search), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { NULL },
+};
+
+static const AVClass asf_class = {
+ .class_name = "asf demuxer",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
#undef NDEBUG
#include <assert.h>
@@ -713,7 +729,9 @@ static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb)
// if we do not know packet size, allow skipping up to 32 kB
off= 32768;
- if (s->packet_size > 0)
+ if (asf->no_resync_search)
+ off = 3;
+ else if (s->packet_size > 0)
off= (avio_tell(pb) - s->data_offset) % s->packet_size + 3;
c=d=e=-1;
@@ -1302,4 +1320,5 @@ AVInputFormat ff_asf_demuxer = {
.read_seek = asf_read_seek,
.read_timestamp = asf_read_pts,
.flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH,
+ .priv_class = &asf_class,
};