History

Merge commit '6896f95b2483e52e717e2c75a4fd24fcb0e14b67'

* commit '6896f95b2483e52e717e2c75a4fd24fcb0e14b67': vorbis_parser: add an AV prefix to VorbisParseContext Conflicts: libavcodec/vorbis_parser.c

Michael Niedermayer committed 12 years ago

Commit 5f7887c2 parents a061702 6896f954 files · +16 −16Browse files

Unified · Split

4 files
  1. libavcodec/libvorbisenc.c +1 −1
  2. libavcodec/vorbis_parser.c +8 −8
  3. libavcodec/vorbis_parser.h +6 −6
  4. libavformat/oggparsevorbis.c +1 −1
libavcodec/libvorbisenc.c+1−1
@@ -49,7 +49,7 @@ typedef struct LibvorbisEncContext { · 48 unmodified lines
49 int dsp_initialized; /**< vd has been initialized */49 int dsp_initialized; /**< vd has been initialized */
50 vorbis_comment vc; /**< VorbisComment info */50 vorbis_comment vc; /**< VorbisComment info */
51 double iblock; /**< impulse block bias option */51 double iblock; /**< impulse block bias option */
52 VorbisParseContext vp; /**< parse context to get durations */52 AVVorbisParseContext vp; /**< parse context to get durations */
53 AudioFrameQueue afq; /**< frame queue for timestamps */53 AudioFrameQueue afq; /**< frame queue for timestamps */
54} LibvorbisEncContext;54} LibvorbisEncContext;
55 55
libavcodec/vorbis_parser.c+8−8
@@ -38,7 +38,7 @@ static const AVClass vorbis_parser_class = { · 37 unmodified lines
38 .version = LIBAVUTIL_VERSION_INT,38 .version = LIBAVUTIL_VERSION_INT,
39};39};
40 40
41static int parse_id_header(VorbisParseContext *s,41static int parse_id_header(AVVorbisParseContext *s,
42 const uint8_t *buf, int buf_size)42 const uint8_t *buf, int buf_size)
43{43{
44 /* Id header should be 30 bytes */44 /* Id header should be 30 bytes */
@@ -70,7 +70,7 @@ static int parse_id_header(VorbisParseContext *s, · 25 unmodified lines
70 return 0;70 return 0;
71}71}
72 72
73static int parse_setup_header(VorbisParseContext *s,73static int parse_setup_header(AVVorbisParseContext *s,
74 const uint8_t *buf, int buf_size)74 const uint8_t *buf, int buf_size)
75{75{
76 GetBitContext gb, gb0;76 GetBitContext gb, gb0;
@@ -181,7 +181,7 @@ bad_header: · 104 unmodified lines
181 return ret;181 return ret;
182}182}
183 183
184int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s)184int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, AVVorbisParseContext *s)
185{185{
186 uint8_t *header_start[3];186 uint8_t *header_start[3];
187 int header_len[3];187 int header_len[3];
@@ -209,7 +209,7 @@ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s) · 21 unmodified lines
209 return 0;209 return 0;
210}210}
211 211
212int avpriv_vorbis_parse_frame_flags(VorbisParseContext *s, const uint8_t *buf,212int avpriv_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
213 int buf_size, int *flags)213 int buf_size, int *flags)
214{214{
215 int duration = 0;215 int duration = 0;
@@ -258,13 +258,13 @@ bad_packet: · 42 unmodified lines
258 return duration;258 return duration;
259}259}
260 260
261int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,261int avpriv_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
262 int buf_size)262 int buf_size)
263{263{
264 return avpriv_vorbis_parse_frame_flags(s, buf, buf_size, NULL);264 return avpriv_vorbis_parse_frame_flags(s, buf, buf_size, NULL);
265}265}
266 266
267void avpriv_vorbis_parse_reset(VorbisParseContext *s)267void avpriv_vorbis_parse_reset(AVVorbisParseContext *s)
268{268{
269 if (s->valid_extradata)269 if (s->valid_extradata)
270 s->previous_blocksize = s->blocksize[0];270 s->previous_blocksize = s->blocksize[0];
@@ -275,7 +275,7 @@ static int vorbis_parse(AVCodecParserContext *s1, AVCodecContext *avctx, · 4 unmodified lines
275 const uint8_t **poutbuf, int *poutbuf_size,275 const uint8_t **poutbuf, int *poutbuf_size,
276 const uint8_t *buf, int buf_size)276 const uint8_t *buf, int buf_size)
277{277{
278 VorbisParseContext *s = s1->priv_data;278 AVVorbisParseContext *s = s1->priv_data;
279 int duration;279 int duration;
280 280
281 if (!s->extradata_parsed && avctx->extradata && avctx->extradata_size)281 if (!s->extradata_parsed && avctx->extradata && avctx->extradata_size)
@@ -295,7 +295,7 @@ end: · 13 unmodified lines
295 295
296AVCodecParser ff_vorbis_parser = {296AVCodecParser ff_vorbis_parser = {
297 .codec_ids = { AV_CODEC_ID_VORBIS },297 .codec_ids = { AV_CODEC_ID_VORBIS },
298 .priv_data_size = sizeof(VorbisParseContext),298 .priv_data_size = sizeof(AVVorbisParseContext),
299 .parser_parse = vorbis_parse,299 .parser_parse = vorbis_parse,
300};300};
301#endif /* CONFIG_VORBIS_PARSER */301#endif /* CONFIG_VORBIS_PARSER */
libavcodec/vorbis_parser.h+6−6
@@ -30,7 +30,7 @@ · 29 unmodified lines
30 30
31#include "avcodec.h"31#include "avcodec.h"
32 32
33typedef struct VorbisParseContext {33typedef struct AVVorbisParseContext {
34 const AVClass *class;34 const AVClass *class;
35 int extradata_parsed; ///< we have attempted to parse extradata35 int extradata_parsed; ///< we have attempted to parse extradata
36 int valid_extradata; ///< extradata is valid, so we can calculate duration36 int valid_extradata; ///< extradata is valid, so we can calculate duration
@@ -40,7 +40,7 @@ typedef struct VorbisParseContext { · 3 unmodified lines
40 int mode_count; ///< number of modes40 int mode_count; ///< number of modes
41 int mode_mask; ///< bitmask used to get the mode in each packet41 int mode_mask; ///< bitmask used to get the mode in each packet
42 int prev_mask; ///< bitmask used to get the previous mode flag in each packet42 int prev_mask; ///< bitmask used to get the previous mode flag in each packet
43} VorbisParseContext;43} AVVorbisParseContext;
44 44
45/**45/**
46 * Initialize the Vorbis parser using headers in the extradata.46 * Initialize the Vorbis parser using headers in the extradata.
@@ -48,7 +48,7 @@ typedef struct VorbisParseContext { · 1 unmodified line
48 * @param avctx codec context48 * @param avctx codec context
49 * @param s Vorbis parser context49 * @param s Vorbis parser context
50 */50 */
51int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s);51int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, AVVorbisParseContext *s);
52 52
53#define VORBIS_FLAG_HEADER 0x0000000153#define VORBIS_FLAG_HEADER 0x00000001
54#define VORBIS_FLAG_COMMENT 0x0000000254#define VORBIS_FLAG_COMMENT 0x00000002
@@ -65,7 +65,7 @@ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s); · 10 unmodified lines
65 * @param buf_size size of the buffer65 * @param buf_size size of the buffer
66 * @param flags flags for special frames66 * @param flags flags for special frames
67 */67 */
68int avpriv_vorbis_parse_frame_flags(VorbisParseContext *s, const uint8_t *buf,68int avpriv_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
69 int buf_size, int *flags);69 int buf_size, int *flags);
70 70
71/**71/**
@@ -78,9 +78,9 @@ int avpriv_vorbis_parse_frame_flags(VorbisParseContext *s, const uint8_t *buf, · 6 unmodified lines
78 * @param buf buffer containing a Vorbis frame78 * @param buf buffer containing a Vorbis frame
79 * @param buf_size size of the buffer79 * @param buf_size size of the buffer
80 */80 */
81int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,81int avpriv_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
82 int buf_size);82 int buf_size);
83 83
84void avpriv_vorbis_parse_reset(VorbisParseContext *s);84void avpriv_vorbis_parse_reset(AVVorbisParseContext *s);
85 85
86#endif /* AVCODEC_VORBIS_PARSER_H */86#endif /* AVCODEC_VORBIS_PARSER_H */
libavformat/oggparsevorbis.c+1−1
@@ -213,7 +213,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, · 212 unmodified lines
213struct oggvorbis_private {213struct oggvorbis_private {
214 unsigned int len[3];214 unsigned int len[3];
215 unsigned char *packet[3];215 unsigned char *packet[3];
216 VorbisParseContext vp;216 AVVorbisParseContext vp;
217 int64_t final_pts;217 int64_t final_pts;
218 int final_duration;218 int final_duration;
219};219};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t