Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sixue.cheng
FFmpeg
Commits
e6c52cee
Commit
e6c52cee
authored
14 years ago
by
Justin Ruggles
Browse files
Options
Download
Email Patches
Plain Diff
Replace usages of av_get_bits_per_sample_fmt() with av_get_bytes_per_sample().
av_get_bits_per_sample_fmt() is deprecated.
parent
c5ee7407
No related merge requests found
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
ffmpeg.c
+3
-3
ffmpeg.c
ffplay.c
+1
-1
ffplay.c
libavcodec/aacdec.c
+1
-1
libavcodec/aacdec.c
libavcodec/ac3dec.c
+1
-1
libavcodec/ac3dec.c
libavcodec/alsdec.c
+2
-2
libavcodec/alsdec.c
libavcodec/dca.c
+1
-1
libavcodec/dca.c
libavcodec/resample.c
+2
-2
libavcodec/resample.c
libavcodec/utils.c
+1
-1
libavcodec/utils.c
libavcodec/vmdav.c
+1
-1
libavcodec/vmdav.c
libavcodec/vorbisdec.c
+1
-1
libavcodec/vorbisdec.c
libavfilter/defaults.c
+1
-1
libavfilter/defaults.c
libavformat/matroskaenc.c
+1
-1
libavformat/matroskaenc.c
with
16 additions
and
16 deletions
+16
-16
ffmpeg.c
+
3
-
3
View file @
e6c52cee
...
...
@@ -778,8 +778,8 @@ static void do_audio_out(AVFormatContext *s,
int
size_out
,
frame_bytes
,
ret
,
resample_changed
;
AVCodecContext
*
enc
=
ost
->
st
->
codec
;
AVCodecContext
*
dec
=
ist
->
st
->
codec
;
int
osize
=
av_get_b
it
s_per_sample
_fmt
(
enc
->
sample_fmt
)
/
8
;
int
isize
=
av_get_b
it
s_per_sample
_fmt
(
dec
->
sample_fmt
)
/
8
;
int
osize
=
av_get_b
yte
s_per_sample
(
enc
->
sample_fmt
);
int
isize
=
av_get_b
yte
s_per_sample
(
dec
->
sample_fmt
);
const
int
coded_bps
=
av_get_bits_per_sample
(
enc
->
codec
->
id
);
need_realloc:
...
...
@@ -1481,7 +1481,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
#endif
AVPacket
avpkt
;
int
bps
=
av_get_b
it
s_per_sample
_fmt
(
ist
->
st
->
codec
->
sample_fmt
)
>>
3
;
int
bps
=
av_get_b
yte
s_per_sample
(
ist
->
st
->
codec
->
sample_fmt
);
if
(
ist
->
next_pts
==
AV_NOPTS_VALUE
)
ist
->
next_pts
=
ist
->
pts
;
...
...
This diff is collapsed.
Click to expand it.
ffplay.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -2032,7 +2032,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
if
(
is
->
reformat_ctx
)
{
const
void
*
ibuf
[
6
]
=
{
is
->
audio_buf1
};
void
*
obuf
[
6
]
=
{
is
->
audio_buf2
};
int
istride
[
6
]
=
{
av_get_b
it
s_per_sample
_fmt
(
dec
->
sample_fmt
)
/
8
};
int
istride
[
6
]
=
{
av_get_b
yte
s_per_sample
(
dec
->
sample_fmt
)};
int
ostride
[
6
]
=
{
2
};
int
len
=
data_size
/
istride
[
0
];
if
(
av_audio_convert
(
is
->
reformat_ctx
,
obuf
,
ostride
,
ibuf
,
istride
,
len
)
<
0
)
{
...
...
This diff is collapsed.
Click to expand it.
libavcodec/aacdec.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -2177,7 +2177,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
}
data_size_tmp
=
samples
*
avctx
->
channels
*
(
av_get_b
it
s_per_sample
_fmt
(
avctx
->
sample_fmt
)
/
8
)
;
av_get_b
yte
s_per_sample
(
avctx
->
sample_fmt
);
if
(
*
data_size
<
data_size_tmp
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Output buffer too small (%d) or trying to output too many samples (%d) for this frame.
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
libavcodec/ac3dec.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -1422,7 +1422,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
}
}
*
data_size
=
s
->
num_blocks
*
256
*
avctx
->
channels
*
(
av_get_b
it
s_per_sample
_fmt
(
avctx
->
sample_fmt
)
/
8
)
;
av_get_b
yte
s_per_sample
(
avctx
->
sample_fmt
);
return
FFMIN
(
buf_size
,
s
->
frame_size
);
}
...
...
This diff is collapsed.
Click to expand it.
libavcodec/alsdec.c
+
2
-
2
View file @
e6c52cee
...
...
@@ -1450,7 +1450,7 @@ static int decode_frame(AVCodecContext *avctx,
// check for size of decoded data
size
=
ctx
->
cur_frame_length
*
avctx
->
channels
*
(
av_get_b
it
s_per_sample
_fmt
(
avctx
->
sample_fmt
)
>>
3
)
;
av_get_b
yte
s_per_sample
(
avctx
->
sample_fmt
);
if
(
size
>
*
data_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Decoded data exceeds buffer size.
\n
"
);
...
...
@@ -1714,7 +1714,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx
->
crc_buffer
=
av_malloc
(
sizeof
(
*
ctx
->
crc_buffer
)
*
ctx
->
cur_frame_length
*
avctx
->
channels
*
(
av_get_b
it
s_per_sample
_fmt
(
avctx
->
sample_fmt
)
>>
3
)
);
av_get_b
yte
s_per_sample
(
avctx
->
sample_fmt
));
if
(
!
ctx
->
crc_buffer
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Allocating buffer memory failed.
\n
"
);
decode_end
(
avctx
);
...
...
This diff is collapsed.
Click to expand it.
libavcodec/dca.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -1813,7 +1813,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
}
out_size
=
256
/
8
*
s
->
sample_blocks
*
channels
*
(
av_get_b
it
s_per_sample
_fmt
(
avctx
->
sample_fmt
)
/
8
)
;
av_get_b
yte
s_per_sample
(
avctx
->
sample_fmt
);
if
(
*
data_size
<
out_size
)
return
-
1
;
*
data_size
=
out_size
;
...
...
This diff is collapsed.
Click to expand it.
libavcodec/resample.c
+
2
-
2
View file @
e6c52cee
...
...
@@ -187,8 +187,8 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
s
->
sample_fmt
[
0
]
=
sample_fmt_in
;
s
->
sample_fmt
[
1
]
=
sample_fmt_out
;
s
->
sample_size
[
0
]
=
av_get_b
it
s_per_sample
_fmt
(
s
->
sample_fmt
[
0
])
>>
3
;
s
->
sample_size
[
1
]
=
av_get_b
it
s_per_sample
_fmt
(
s
->
sample_fmt
[
1
])
>>
3
;
s
->
sample_size
[
0
]
=
av_get_b
yte
s_per_sample
(
s
->
sample_fmt
[
0
]);
s
->
sample_size
[
1
]
=
av_get_b
yte
s_per_sample
(
s
->
sample_fmt
[
1
]);
if
(
s
->
sample_fmt
[
0
]
!=
AV_SAMPLE_FMT_S16
)
{
if
(
!
(
s
->
convert_ctx
[
0
]
=
av_audio_convert_alloc
(
AV_SAMPLE_FMT_S16
,
1
,
...
...
This diff is collapsed.
Click to expand it.
libavcodec/utils.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -1131,7 +1131,7 @@ int av_get_bits_per_sample(enum CodecID codec_id){
#if FF_API_OLD_SAMPLE_FMT
int
av_get_bits_per_sample_format
(
enum
AVSampleFormat
sample_fmt
)
{
return
av_get_b
it
s_per_sample
_fmt
(
sample_fmt
);
return
av_get_b
yte
s_per_sample
(
sample_fmt
)
<<
3
;
}
#endif
...
...
This diff is collapsed.
Click to expand it.
libavcodec/vmdav.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -447,7 +447,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
else
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_U8
;
s
->
out_bps
=
av_get_b
it
s_per_sample
_fmt
(
avctx
->
sample_fmt
)
>>
3
;
s
->
out_bps
=
av_get_b
yte
s_per_sample
(
avctx
->
sample_fmt
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%d channels, %d bits/sample, "
"block align = %d, sample rate = %d
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
libavcodec/vorbisdec.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -1646,7 +1646,7 @@ static int vorbis_decode_frame(AVCodecContext *avccontext,
vc
->
audio_channels
);
*
data_size
=
len
*
vc
->
audio_channels
*
(
av_get_b
it
s_per_sample
_fmt
(
avccontext
->
sample_fmt
)
/
8
)
;
av_get_b
yte
s_per_sample
(
avccontext
->
sample_fmt
);
return
buf_size
;
}
...
...
This diff is collapsed.
Click to expand it.
libavfilter/defaults.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -84,7 +84,7 @@ AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int per
samples
->
refcount
=
1
;
samples
->
free
=
ff_avfilter_default_free_buffer
;
sample_size
=
av_get_b
it
s_per_sample
_fmt
(
sample_fmt
)
>>
3
;
sample_size
=
av_get_b
yte
s_per_sample
(
sample_fmt
);
chans_nb
=
av_get_channel_layout_nb_channels
(
channel_layout
);
per_channel_size
=
size
/
chans_nb
;
...
...
This diff is collapsed.
Click to expand it.
libavformat/matroskaenc.c
+
1
-
1
View file @
e6c52cee
...
...
@@ -527,7 +527,7 @@ static int mkv_write_tracks(AVFormatContext *s)
AVDictionaryEntry
*
tag
;
if
(
!
bit_depth
)
bit_depth
=
av_get_b
it
s_per_sample
_fmt
(
codec
->
sample_fmt
);
bit_depth
=
av_get_b
yte
s_per_sample
(
codec
->
sample_fmt
)
<<
3
;
if
(
codec
->
codec_id
==
CODEC_ID_AAC
)
get_aac_sample_rates
(
s
,
codec
,
&
sample_rate
,
&
output_sample_rate
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help