History

Merge remote-tracking branch 'qatar/master'

* qatar/master: fft: init functions with INIT_XMM/YMM. pcmenc: set frame_size to 0. gsm demuxer: use generic seeking instead of a gsm-specific function. gsm demuxer: return packets with only 1 gsm block at a time. avcodec: add GSM parser doc: Replace ffmpeg references in avserver config file by avconv. doc: Fix names of av_log color environment variables. Fix a bunch of platform name and other typos. Add some missing changelog entries and release 0.8_beta2 No longer build libpostproc by default wtv: fix memleaks during normal operation threads: add CODEC_CAP_AUTO_THREADS for libvpx and xavs Conflicts: Changelog RELEASE cmdutils.c configure doc/ffserver.conf doc/platform.texi ffplay.c libavcodec/Makefile libavcodec/version.h libavformat/wtv.c

Michael Niedermayer committed 14 years ago

Commit 794006f2 parents 4093d13 e7d02b024 files · +144 −59Browse files

Unified · Split

24 files
  1. Changelog +3 −0
  2. RELEASE +1 −0
  3. cmdutils.c +4 −0
  4. configure +1 −1
  5. doc/avtools-common-opts.texi +2 −2
  6. libavcodec/Makefile +1 −0
  7. libavcodec/allcodecs.c +1 −0
  8. libavcodec/error_resilience.c +1 −1
  9. libavcodec/gsm.h +31 −0
  10. libavcodec/gsm_parser.c +79 −0
  11. libavcodec/gsmdec_data.h +0 −5
  12. libavcodec/gsmdec_template.c +1 −0
  13. libavcodec/libgsm.c +2 −5
  14. libavcodec/libvpxdec.c +2 −1
  15. libavcodec/libvpxenc.c +1 −1
  16. libavcodec/libxavs.c +1 −1
  17. libavcodec/msgsmdec.c +1 −0
  18. libavcodec/msrle.c +2 −2
  19. libavcodec/pcm.c +1 −1
  20. libavcodec/version.h +1 −1
  21. libavcodec/x86/fft_mmx.asm +3 −0
  22. libavformat/gsmdec.c +3 −37
  23. libavformat/wtvdec.c +1 −0
  24. tools/patcheck +1 −1
Changelog+3−0
@@ -13,6 +13,7 @@ version next: · 12 unmodified lines
13- tinterlace video filter13- tinterlace video filter
14- astreamsync audio filter14- astreamsync audio filter
15- amerge audio filter15- amerge audio filter
16- GSM audio parser
16- Automatic thread count based on detection number of (available) CPU cores17- Automatic thread count based on detection number of (available) CPU cores
17- y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder18- y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder
18- ffprobe -show_error option19- ffprobe -show_error option
@@ -22,6 +23,8 @@ version next: · 3 unmodified lines
22- ffprobe -show_frames option23- ffprobe -show_frames option
23- silencedetect audio filter24- silencedetect audio filter
24- ffprobe -show_program_version, -show_library_versions, -show_versions options25- ffprobe -show_program_version, -show_library_versions, -show_versions options
26- rv34: frame-level multi-threading
27- optimized iMDCT transform on x86 using SSE for for mpegaudiodec
25 28
26 29
27version 0.9:30version 0.9:
RELEASE+1−0
@@ -1 +1,2 @@
10.9.1.git10.9.1.git
2
cmdutils.c+4−0
@@ -34,7 +34,9 @@ · 33 unmodified lines
34#include "libavdevice/avdevice.h"34#include "libavdevice/avdevice.h"
35#include "libswscale/swscale.h"35#include "libswscale/swscale.h"
36#include "libswresample/swresample.h"36#include "libswresample/swresample.h"
37#if CONFIG_POSTPROC
37#include "libpostproc/postprocess.h"38#include "libpostproc/postprocess.h"
39#endif
38#include "libavutil/avstring.h"40#include "libavutil/avstring.h"
39#include "libavutil/mathematics.h"41#include "libavutil/mathematics.h"
40#include "libavutil/parseutils.h"42#include "libavutil/parseutils.h"
@@ -607,7 +609,9 @@ static void print_all_libs_info(int flags, int level) · 566 unmodified lines
607 PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);609 PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);
608 PRINT_LIB_INFO(swscale, SWSCALE, flags, level);610 PRINT_LIB_INFO(swscale, SWSCALE, flags, level);
609 PRINT_LIB_INFO(swresample,SWRESAMPLE, flags, level);611 PRINT_LIB_INFO(swresample,SWRESAMPLE, flags, level);
612#if CONFIG_POSTPROC
610 PRINT_LIB_INFO(postproc, POSTPROC, flags, level);613 PRINT_LIB_INFO(postproc, POSTPROC, flags, level);
614#endif
611}615}
612 616
613static void print_program_info(int flags, int level)617static void print_program_info(int flags, int level)
configure+1−1
@@ -253,7 +253,7 @@ Advanced options (experts only): · 252 unmodified lines
253 --disable-armvfp disable ARM VFP optimizations253 --disable-armvfp disable ARM VFP optimizations
254 --disable-iwmmxt disable iwmmxt optimizations254 --disable-iwmmxt disable iwmmxt optimizations
255 --disable-mmi disable MMI optimizations255 --disable-mmi disable MMI optimizations
256 --disable-neon disable neon optimizations256 --disable-neon disable NEON optimizations
257 --disable-vis disable VIS optimizations257 --disable-vis disable VIS optimizations
258 --disable-yasm disable use of yasm assembler258 --disable-yasm disable use of yasm assembler
259 --enable-pic build position-independent code259 --enable-pic build position-independent code
doc/avtools-common-opts.texi+2−2
@@ -119,8 +119,8 @@ Set the logging level used by the library. · 118 unmodified lines
119By default the program logs to stderr, if coloring is supported by the119By default the program logs to stderr, if coloring is supported by the
120terminal, colors are used to mark errors and warnings. Log coloring120terminal, colors are used to mark errors and warnings. Log coloring
121can be disabled setting the environment variable121can be disabled setting the environment variable
122@env{FFMPEG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting122@env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
123the environment variable @env{FFMPEG_FORCE_COLOR}.123the environment variable @env{AV_LOG_FORCE_COLOR}.
124The use of the environment variable @env{NO_COLOR} is deprecated and124The use of the environment variable @env{NO_COLOR} is deprecated and
125will be dropped in a following FFmpeg version.125will be dropped in a following FFmpeg version.
126 126
libavcodec/Makefile+1−0
@@ -655,6 +655,7 @@ OBJS-$(CONFIG_DVBSUB_PARSER) += dvbsub_parser.o · 654 unmodified lines
655OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o655OBJS-$(CONFIG_DVDSUB_PARSER) += dvdsub_parser.o
656OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \656OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
657 vorbis_data.o657 vorbis_data.o
658OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o
658OBJS-$(CONFIG_H261_PARSER) += h261_parser.o659OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
659OBJS-$(CONFIG_H263_PARSER) += h263_parser.o660OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
660OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o \661OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264.o \
libavcodec/allcodecs.c+1−0
@@ -432,6 +432,7 @@ void avcodec_register_all(void) · 431 unmodified lines
432 REGISTER_PARSER (DVBSUB, dvbsub);432 REGISTER_PARSER (DVBSUB, dvbsub);
433 REGISTER_PARSER (DVDSUB, dvdsub);433 REGISTER_PARSER (DVDSUB, dvdsub);
434 REGISTER_PARSER (FLAC, flac);434 REGISTER_PARSER (FLAC, flac);
435 REGISTER_PARSER (GSM, gsm);
435 REGISTER_PARSER (H261, h261);436 REGISTER_PARSER (H261, h261);
436 REGISTER_PARSER (H263, h263);437 REGISTER_PARSER (H263, h263);
437 REGISTER_PARSER (H264, h264);438 REGISTER_PARSER (H264, h264);
libavcodec/error_resilience.c+1−1
@@ -50,7 +50,7 @@ static void decode_mb(MpegEncContext *s, int ref){ · 49 unmodified lines
50 h->mb_xy= s->mb_x + s->mb_y*s->mb_stride;50 h->mb_xy= s->mb_x + s->mb_y*s->mb_stride;
51 memset(h->non_zero_count_cache, 0, sizeof(h->non_zero_count_cache));51 memset(h->non_zero_count_cache, 0, sizeof(h->non_zero_count_cache));
52 assert(ref>=0);52 assert(ref>=0);
53 /* FIXME: It is posible albeit uncommon that slice references53 /* FIXME: It is possible albeit uncommon that slice references
54 * differ between slices. We take the easy approach and ignore54 * differ between slices. We take the easy approach and ignore
55 * it for now. If this turns out to have any relevance in55 * it for now. If this turns out to have any relevance in
56 * practice then correct remapping should be added. */56 * practice then correct remapping should be added. */
libavcodec/gsm.h+31−0
@@ -0,0 +1,31 @@
1/*
2 * GSM common header
3 *
4 * This file is part of Libav.
5 *
6 * Libav is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * Libav is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with Libav; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef AVCODEC_GSM_H
22#define AVCODEC_GSM_H
23
24/* bytes per block */
25#define GSM_BLOCK_SIZE 33
26#define GSM_MS_BLOCK_SIZE 65
27
28/* samples per block */
29#define GSM_FRAME_SIZE 160
30
31#endif /* AVCODEC_GSM_H */
libavcodec/gsm_parser.c+79−0
@@ -0,0 +1,79 @@
1/*
2 * Copyright (c) 2012 Justin Ruggles
3 *
4 * This file is part of Libav.
5 *
6 * Libav is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * Libav is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with Libav; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/**
22 * @file
23 * GSM audio parser
24 *
25 * Splits packets into individual blocks.
26 */
27
28#include "parser.h"
29#include "gsm.h"
30
31typedef struct GSMParseContext {
32 ParseContext pc;
33 int block_size;
34 int remaining;
35} GSMParseContext;
36
37static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
38 const uint8_t **poutbuf, int *poutbuf_size,
39 const uint8_t *buf, int buf_size)
40{
41 GSMParseContext *s = s1->priv_data;
42 ParseContext *pc = &s->pc;
43 int next;
44
45 if (!s->block_size) {
46 switch (avctx->codec_id) {
47 case CODEC_ID_GSM: s->block_size = GSM_BLOCK_SIZE; break;
48 case CODEC_ID_GSM_MS: s->block_size = GSM_MS_BLOCK_SIZE; break;
49 default:
50 return AVERROR(EINVAL);
51 }
52 }
53
54 if (!s->remaining)
55 s->remaining = s->block_size;
56 if (s->remaining <= buf_size) {
57 next = s->remaining;
58 s->remaining = 0;
59 } else {
60 next = END_NOT_FOUND;
61 s->remaining -= buf_size;
62 }
63
64 if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) {
65 *poutbuf = NULL;
66 *poutbuf_size = 0;
67 return buf_size;
68 }
69 *poutbuf = buf;
70 *poutbuf_size = buf_size;
71 return next;
72}
73
74AVCodecParser ff_gsm_parser = {
75 .codec_ids = { CODEC_ID_GSM, CODEC_ID_GSM_MS },
76 .priv_data_size = sizeof(GSMParseContext),
77 .parser_parse = gsm_parse,
78 .parser_close = ff_parse_close,
79};
libavcodec/gsmdec_data.h+0−5
@@ -25,11 +25,6 @@ · 24 unmodified lines
25#include <stdint.h>25#include <stdint.h>
26#include "avcodec.h"26#include "avcodec.h"
27 27
28// input and output sizes in byte
29#define GSM_BLOCK_SIZE 33
30#define GSM_MS_BLOCK_SIZE 65
31#define GSM_FRAME_SIZE 160
32
33typedef struct {28typedef struct {
34 AVFrame frame;29 AVFrame frame;
35 // Contains first 120 elements from the previous frame30 // Contains first 120 elements from the previous frame
libavcodec/gsmdec_template.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
25 */25 */
26 26
27#include "get_bits.h"27#include "get_bits.h"
28#include "gsm.h"
28#include "gsmdec_data.h"29#include "gsmdec_data.h"
29 30
30static void apcm_dequant_add(GetBitContext *gb, int16_t *dst)31static void apcm_dequant_add(GetBitContext *gb, int16_t *dst)
libavcodec/libgsm.c+2−5
@@ -27,13 +27,10 @@ · 26 unmodified lines
27 27
28// The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html28// The idiosyncrasies of GSM-in-WAV are explained at http://kbs.cs.tu-berlin.de/~jutta/toast.html
29 29
30#include "avcodec.h"
31#include <gsm/gsm.h>30#include <gsm/gsm.h>
32 31
33// gsm.h misses some essential constants32#include "avcodec.h"
34#define GSM_BLOCK_SIZE 3333#include "gsm.h"
35#define GSM_MS_BLOCK_SIZE 65
36#define GSM_FRAME_SIZE 160
37 34
38static av_cold int libgsm_encode_init(AVCodecContext *avctx) {35static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
39 if (avctx->channels > 1) {36 if (avctx->channels > 1) {
libavcodec/libvpxdec.c+2−1
@@ -119,5 +119,6 @@ AVCodec ff_libvpx_decoder = { · 118 unmodified lines
119 .init = vp8_init,119 .init = vp8_init,
120 .close = vp8_free,120 .close = vp8_free,
121 .decode = vp8_decode,121 .decode = vp8_decode,
122 .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),122 .capabilities = CODEC_CAP_AUTO_THREADS,
123 .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
123};124};
libavcodec/libvpxenc.c+1−1
@@ -622,7 +622,7 @@ AVCodec ff_libvpx_encoder = { · 621 unmodified lines
622 .init = vp8_init,622 .init = vp8_init,
623 .encode = vp8_encode,623 .encode = vp8_encode,
624 .close = vp8_free,624 .close = vp8_free,
625 .capabilities = CODEC_CAP_DELAY,625 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
626 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},626 .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
627 .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),627 .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
628 .priv_class = &class,628 .priv_class = &class,
libavcodec/libxavs.c+1−1
@@ -414,7 +414,7 @@ AVCodec ff_libxavs_encoder = { · 413 unmodified lines
414 .init = XAVS_init,414 .init = XAVS_init,
415 .encode = XAVS_frame,415 .encode = XAVS_frame,
416 .close = XAVS_close,416 .close = XAVS_close,
417 .capabilities = CODEC_CAP_DELAY,417 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
418 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE },418 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE },
419 .long_name = NULL_IF_CONFIG_SMALL("libxavs - the Chinese Audio Video Standard Encoder"),419 .long_name = NULL_IF_CONFIG_SMALL("libxavs - the Chinese Audio Video Standard Encoder"),
420 .priv_class = &class,420 .priv_class = &class,
libavcodec/msgsmdec.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#define BITSTREAM_READER_LE22#define BITSTREAM_READER_LE
23#include "avcodec.h"23#include "avcodec.h"
24#include "msgsmdec.h"24#include "msgsmdec.h"
25#include "gsm.h"
25#include "gsmdec_template.c"26#include "gsmdec_template.c"
26 27
27int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples,28int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples,
libavcodec/msrle.c+2−2
@@ -1,5 +1,5 @@
1/*1/*
2 * Micrsoft RLE Video Decoder2 * Microsoft RLE video decoder
3 * Copyright (C) 2003 the ffmpeg project3 * Copyright (C) 2003 the ffmpeg project
4 *4 *
5 * This file is part of FFmpeg.5 * This file is part of FFmpeg.
@@ -21,7 +21,7 @@ · 15 unmodified lines
21 21
22/**22/**
23 * @file23 * @file
24 * MS RLE Video Decoder by Mike Melanson (melanson@pcisys.net)24 * MS RLE video decoder by Mike Melanson (melanson@pcisys.net)
25 * For more information about the MS RLE format, visit:25 * For more information about the MS RLE format, visit:
26 * http://www.pcisys.net/~melanson/codecs/26 * http://www.pcisys.net/~melanson/codecs/
27 *27 *
libavcodec/pcm.c+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
33 33
34static av_cold int pcm_encode_init(AVCodecContext *avctx)34static av_cold int pcm_encode_init(AVCodecContext *avctx)
35{35{
36 avctx->frame_size = 1;36 avctx->frame_size = 0;
37 switch(avctx->codec->id) {37 switch(avctx->codec->id) {
38 case CODEC_ID_PCM_ALAW:38 case CODEC_ID_PCM_ALAW:
39 pcm_alaw_tableinit();39 pcm_alaw_tableinit();
libavcodec/version.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21#define AVCODEC_VERSION_H21#define AVCODEC_VERSION_H
22 22
23#define LIBAVCODEC_VERSION_MAJOR 5323#define LIBAVCODEC_VERSION_MAJOR 53
24#define LIBAVCODEC_VERSION_MINOR 5424#define LIBAVCODEC_VERSION_MINOR 55
25#define LIBAVCODEC_VERSION_MICRO 10025#define LIBAVCODEC_VERSION_MICRO 100
26 26
27#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \27#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
libavcodec/x86/fft_mmx.asm+3−0
@@ -640,11 +640,14 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits · 639 unmodified lines
640%endmacro ; DECL_FFT640%endmacro ; DECL_FFT
641 641
642%ifdef HAVE_AVX642%ifdef HAVE_AVX
643INIT_YMM
643DECL_FFT 6, _avx644DECL_FFT 6, _avx
644DECL_FFT 6, _avx, _interleave645DECL_FFT 6, _avx, _interleave
645%endif646%endif
647INIT_XMM
646DECL_FFT 5, _sse648DECL_FFT 5, _sse
647DECL_FFT 5, _sse, _interleave649DECL_FFT 5, _sse, _interleave
650INIT_MMX
648DECL_FFT 4, _3dn651DECL_FFT 4, _3dn
649DECL_FFT 4, _3dn, _interleave652DECL_FFT 4, _3dn, _interleave
650DECL_FFT 4, _3dn2653DECL_FFT 4, _3dn2
libavformat/gsmdec.c+3−37
@@ -37,7 +37,7 @@ static int gsm_read_packet(AVFormatContext *s, AVPacket *pkt) · 36 unmodified lines
37{37{
38 int ret, size;38 int ret, size;
39 39
40 size = GSM_BLOCK_SIZE * 32;40 size = GSM_BLOCK_SIZE;
41 41
42 pkt->pos = avio_tell(s->pb);42 pkt->pos = avio_tell(s->pb);
43 pkt->stream_index = 0;43 pkt->stream_index = 0;
@@ -48,7 +48,7 @@ static int gsm_read_packet(AVFormatContext *s, AVPacket *pkt) · 4 unmodified lines
48 return ret < 0 ? ret : AVERROR(EIO);48 return ret < 0 ? ret : AVERROR(EIO);
49 }49 }
50 pkt->size = ret;50 pkt->size = ret;
51 pkt->duration = ret / GSM_BLOCK_SIZE;51 pkt->duration = 1;
52 pkt->pts = pkt->pos / GSM_BLOCK_SIZE;52 pkt->pts = pkt->pos / GSM_BLOCK_SIZE;
53 53
54 return 0;54 return 0;
@@ -65,7 +65,6 @@ static int gsm_read_header(AVFormatContext *s, AVFormatParameters *ap) · 10 unmodified lines
65 st->codec->codec_id = s->iformat->value;65 st->codec->codec_id = s->iformat->value;
66 st->codec->channels = 1;66 st->codec->channels = 1;
67 st->codec->sample_rate = c->sample_rate;67 st->codec->sample_rate = c->sample_rate;
68 st->codec->block_align = GSM_BLOCK_SIZE;
69 st->codec->bit_rate = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES;68 st->codec->bit_rate = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES;
70 69
71 avpriv_set_pts_info(st, 64, GSM_BLOCK_SAMPLES, GSM_SAMPLE_RATE);70 avpriv_set_pts_info(st, 64, GSM_BLOCK_SAMPLES, GSM_SAMPLE_RATE);
@@ -73,39 +72,6 @@ static int gsm_read_header(AVFormatContext *s, AVFormatParameters *ap) · 1 unmodified line
73 return 0;72 return 0;
74}73}
75 74
76static int gsm_read_seek2(AVFormatContext *s, int stream_index, int64_t min_ts,
77 int64_t ts, int64_t max_ts, int flags)
78{
79 GSMDemuxerContext *c = s->priv_data;
80
81 /* convert timestamps to file positions */
82 if (!(flags & AVSEEK_FLAG_BYTE)) {
83 if (stream_index < 0) {
84 AVRational bitrate_q = { GSM_BLOCK_SAMPLES, c->sample_rate * GSM_BLOCK_SIZE };
85 ts = av_rescale_q(ts, AV_TIME_BASE_Q, bitrate_q);
86 min_ts = av_rescale_q(min_ts, AV_TIME_BASE_Q, bitrate_q);
87 max_ts = av_rescale_q(max_ts, AV_TIME_BASE_Q, bitrate_q);
88 } else {
89 ts *= GSM_BLOCK_SIZE;
90 min_ts *= GSM_BLOCK_SIZE;
91 max_ts *= GSM_BLOCK_SIZE;
92 }
93 }
94 /* round to nearest block boundary */
95 ts = (ts + GSM_BLOCK_SIZE / 2) / GSM_BLOCK_SIZE * GSM_BLOCK_SIZE;
96 ts = FFMAX(0, ts);
97
98 /* handle min/max */
99 while (ts < min_ts)
100 ts += GSM_BLOCK_SIZE;
101 while (ts > max_ts)
102 ts -= GSM_BLOCK_SIZE;
103 if (ts < min_ts || ts > max_ts)
104 return -1;
105
106 return avio_seek(s->pb, ts, SEEK_SET);
107}
108
109static const AVOption options[] = {75static const AVOption options[] = {
110 { "sample_rate", "", offsetof(GSMDemuxerContext, sample_rate),76 { "sample_rate", "", offsetof(GSMDemuxerContext, sample_rate),
111 AV_OPT_TYPE_INT, {.dbl = GSM_SAMPLE_RATE}, 1, INT_MAX / GSM_BLOCK_SIZE,77 AV_OPT_TYPE_INT, {.dbl = GSM_SAMPLE_RATE}, 1, INT_MAX / GSM_BLOCK_SIZE,
@@ -126,7 +92,7 @@ AVInputFormat ff_gsm_demuxer = { · 14 unmodified lines
126 .priv_data_size = sizeof(GSMDemuxerContext),92 .priv_data_size = sizeof(GSMDemuxerContext),
127 .read_header = gsm_read_header,93 .read_header = gsm_read_header,
128 .read_packet = gsm_read_packet,94 .read_packet = gsm_read_packet,
129 .read_seek2 = gsm_read_seek2,95 .flags = AVFMT_GENERIC_INDEX,
130 .extensions = "gsm",96 .extensions = "gsm",
131 .value = CODEC_ID_GSM,97 .value = CODEC_ID_GSM,
132 .priv_class = &class,98 .priv_class = &class,
libavformat/wtvdec.c+1−0
@@ -1022,6 +1022,7 @@ static int read_seek(AVFormatContext *s, int stream_index, · 1021 unmodified lines
1022static int read_close(AVFormatContext *s)1022static int read_close(AVFormatContext *s)
1023{1023{
1024 WtvContext *wtv = s->priv_data;1024 WtvContext *wtv = s->priv_data;
1025 av_freep(&wtv->index_entries);
1025 wtvfile_close(wtv->pb);1026 wtvfile_close(wtv->pb);
1026 return 0;1027 return 0;
1027}1028}
tools/patcheck+1−1
@@ -67,7 +67,7 @@ $EGREP $OPT '^\+ *(const *|)static' $*| $EGREP --color=always '[^=]= *(0|NULL)[^ · 66 unmodified lines
67cat $TMP67cat $TMP
68hiegrep '# *ifdef * (HAVE|CONFIG)_' 'ifdefs that should be #if' $*68hiegrep '# *ifdef * (HAVE|CONFIG)_' 'ifdefs that should be #if' $*
69 69
70hiegrep '\b(awnser|cant|dont|wont|usefull|successfull|occured|teh|alot|wether|skiped|heigth|informations|colums|loosy|loosing|seperate|preceed|upto|paket)\b' 'common typos' $*70hiegrep '\b(awnser|cant|dont|wont|usefull|successfull|occured|teh|alot|wether|skiped|heigth|informations|colums|loosy|loosing|seperate|preceed|upto|paket|posible)\b' 'common typos' $*
71 71
72hiegrep 'av_log\( *NULL' 'Missing context in av_log' $*72hiegrep 'av_log\( *NULL' 'Missing context in av_log' $*
73hiegrep '[^sn]printf' 'Please use av_log' $*73hiegrep '[^sn]printf' 'Please use av_log' $*

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