diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-19 11:15:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-19 11:24:20 +0200 |
commit | fec6d547cc2782dc4e7a58a666bdeab6bf756d37 (patch) | |
tree | 229d4df714f31c7e4ddf9ce24a215f93ccd5815d /libavformat/wtvdec.c | |
parent | 2a5f4c1ea2c787a305cba626e74a535aee480300 (diff) | |
download | ffmpeg-fec6d547cc2782dc4e7a58a666bdeab6bf756d37.tar.gz |
avformat/wtvdec: drop SHIFT_SECTOR_BITS() macro
it just wraps around a bitwise shift, and makes the code harder to read
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wtvdec.c')
-rw-r--r-- | libavformat/wtvdec.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 0241cee382..9bbea9ca16 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -46,8 +46,6 @@ * */ -#define SHIFT_SECTOR_BITS(a) ((int64_t)(a) << WTV_SECTOR_BITS) - typedef struct { AVIOContext *pb_filesystem; /**< file system (AVFormatContext->pb) */ @@ -62,7 +60,7 @@ typedef struct { static int64_t seek_by_sector(AVIOContext *pb, int64_t sector, int64_t offset) { - return avio_seek(pb, SHIFT_SECTOR_BITS(sector) + offset, SEEK_SET); + return avio_seek(pb, (sector << WTV_SECTOR_BITS) + offset, SEEK_SET); } /** @@ -183,7 +181,7 @@ static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int int nb_sectors1 = read_ints(s->pb, sectors1, WTV_SECTOR_SIZE / 4); int i; - wf->sectors = av_malloc(SHIFT_SECTOR_BITS(nb_sectors1)); + wf->sectors = av_malloc_array(nb_sectors1, 1 << WTV_SECTOR_BITS); if (!wf->sectors) { av_free(wf); return NULL; |