summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcoen Hirschberg <m.hirschberg@activevideo.com>2014-05-27 00:15:41 +0200
committerwm4 <wm4@nowhere>2014-05-28 21:37:50 +0200
commit434242adb5dc045faf16f8bb19aa740732cc3345 (patch)
treeaf5d64f31973a33b70ba23e17cd8e59ee9134702
parent6e58b20cced05c303f1b35d5baa5f79b8ad612f5 (diff)
downloadmpv-434242adb5dc045faf16f8bb19aa740732cc3345.tar.bz2
mpv-434242adb5dc045faf16f8bb19aa740732cc3345.tar.xz
audio: rename i_bps to 'bitrate' to avoid confusion
Since i_bps now contains bits/sec, rename it to reflect this change.
-rw-r--r--audio/decode/ad_lavc.c6
-rw-r--r--audio/decode/ad_mpg123.c4
-rw-r--r--audio/decode/dec_audio.h2
-rw-r--r--demux/demux_lavf.c4
-rw-r--r--demux/demux_raw.c2
-rw-r--r--demux/stheader.h4
-rw-r--r--player/command.c8
-rw-r--r--stream/tv.c2
-rw-r--r--video/decode/dec_video.c4
-rw-r--r--video/decode/dec_video.h2
10 files changed, 19 insertions, 19 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
index b013400cab..a55a5966ae 100644
--- a/audio/decode/ad_lavc.c
+++ b/audio/decode/ad_lavc.c
@@ -229,7 +229,7 @@ static int init(struct dec_audio *da, const char *decoder)
lavc_context->codec_tag = sh->format;
lavc_context->sample_rate = sh_audio->samplerate;
- lavc_context->bit_rate = sh_audio->i_bps;
+ lavc_context->bit_rate = sh_audio->bitrate;
lavc_context->channel_layout = mp_chmap_to_lavc(&sh_audio->channels);
if (sh_audio->wf)
@@ -270,9 +270,9 @@ static int init(struct dec_audio *da, const char *decoder)
}
}
- da->i_bps = lavc_context->bit_rate;
+ da->bitrate = lavc_context->bit_rate;
if (sh_audio->wf && sh_audio->wf->nAvgBytesPerSec)
- da->i_bps = sh_audio->wf->nAvgBytesPerSec * 8;
+ da->bitrate = sh_audio->wf->nAvgBytesPerSec * 8;
return 1;
}
diff --git a/audio/decode/ad_mpg123.c b/audio/decode/ad_mpg123.c
index 3c76eb51b3..7b174aa0d6 100644
--- a/audio/decode/ad_mpg123.c
+++ b/audio/decode/ad_mpg123.c
@@ -278,12 +278,12 @@ static void update_info(struct dec_audio *da)
/* Might not be numerically optimal, but works fine enough. */
con->mean_rate = ((con->mean_count - 1) * con->mean_rate +
bitrate) / con->mean_count;
- da->i_bps = (int) (con->mean_rate + 0.5);
+ da->bitrate = (int) (con->mean_rate + 0.5);
con->delay = 10;
}
} else {
- da->i_bps = bitrate ? bitrate : compute_bitrate(&finfo);
+ da->bitrate = bitrate ? bitrate : compute_bitrate(&finfo);
con->delay = 1;
con->mean_rate = 0.;
con->mean_count = 0;
diff --git a/audio/decode/dec_audio.h b/audio/decode/dec_audio.h
index dc7446bd0d..9108f6f035 100644
--- a/audio/decode/dec_audio.h
+++ b/audio/decode/dec_audio.h
@@ -42,7 +42,7 @@ struct dec_audio {
struct mp_audio decoded; // format of decoded audio (no data, temporarily
// different from decode_buffer during format
// changes)
- int i_bps; // input bitrate, can change with VBR sources
+ int bitrate; // input bitrate, can change with VBR sources
// last known pts value in output from decoder
double pts;
// number of samples output by decoder after last known pts
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 75e6cb41f0..9559c73260 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -433,7 +433,7 @@ static void handle_stream(demuxer_t *demuxer, int i)
if (codec->channel_layout)
mp_chmap_from_lavc(&sh_audio->channels, codec->channel_layout);
sh_audio->samplerate = codec->sample_rate;
- sh_audio->i_bps = codec->bit_rate;
+ sh_audio->bitrate = codec->bit_rate;
export_replaygain(demuxer, st);
@@ -477,7 +477,7 @@ static void handle_stream(demuxer_t *demuxer, int i)
else
sh_video->aspect = codec->width * codec->sample_aspect_ratio.num
/ (float)(codec->height * codec->sample_aspect_ratio.den);
- sh_video->i_bps = codec->bit_rate;
+ sh_video->bitrate = codec->bit_rate;
AVDictionaryEntry *rot = av_dict_get(st->metadata, "rotate", NULL, 0);
if (rot && rot->value) {
diff --git a/demux/demux_raw.c b/demux/demux_raw.c
index ceb5d7bf30..c2579ab536 100644
--- a/demux/demux_raw.c
+++ b/demux/demux_raw.c
@@ -179,7 +179,7 @@ static int demux_rawvideo_open(demuxer_t *demuxer, enum demux_check check)
sh_video->fps = fps;
sh_video->disp_w = width;
sh_video->disp_h = height;
- sh_video->i_bps = fps * imgsize * 8;
+ sh_video->bitrate = fps * imgsize * 8;
struct priv *p = talloc_ptrtype(demuxer, p);
demuxer->priv = p;
diff --git a/demux/stheader.h b/demux/stheader.h
index c8a72795b0..101c75e880 100644
--- a/demux/stheader.h
+++ b/demux/stheader.h
@@ -67,7 +67,7 @@ struct sh_stream {
typedef struct sh_audio {
int samplerate;
struct mp_chmap channels;
- int i_bps; // == bitrate (compressed bits/sec)
+ int bitrate; // compressed bits/sec
// win32-compatible codec parameters:
MP_WAVEFORMATEX *wf;
// note codec extradata may be either under "wf" or "codecdata"
@@ -79,7 +79,7 @@ typedef struct sh_video {
bool avi_dts; // use DTS timing; first frame and DTS is 0
float fps; // frames per second (set only if constant fps)
float aspect; // aspect ratio stored in the file (for prescaling)
- int i_bps; // == bitrate (compressed bits/sec)
+ int bitrate; // compressed bits/sec
int disp_w, disp_h; // display size
int rotate; // intended display rotation, in degrees, [0, 359]
MP_BITMAPINFOHEADER *bih;
diff --git a/player/command.c b/player/command.c
index 7e391e673f..bf18d2fb9e 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1198,10 +1198,10 @@ static int mp_property_audio_bitrate(m_option_t *prop, int action,
return M_PROPERTY_UNAVAILABLE;
switch (action) {
case M_PROPERTY_PRINT:
- *(char **)arg = format_bitrate(mpctx->d_audio->i_bps);
+ *(char **)arg = format_bitrate(mpctx->d_audio->bitrate);
return M_PROPERTY_OK;
case M_PROPERTY_GET:
- *(int *)arg = mpctx->d_audio->i_bps;
+ *(int *)arg = mpctx->d_audio->bitrate;
return M_PROPERTY_OK;
}
return M_PROPERTY_NOT_IMPLEMENTED;
@@ -1848,10 +1848,10 @@ static int mp_property_video_bitrate(m_option_t *prop, int action,
if (!mpctx->d_video)
return M_PROPERTY_UNAVAILABLE;
if (action == M_PROPERTY_PRINT) {
- *(char **)arg = format_bitrate(mpctx->d_video->i_bps);
+ *(char **)arg = format_bitrate(mpctx->d_video->bitrate);
return M_PROPERTY_OK;
}
- return m_property_int_ro(prop, action, arg, mpctx->d_video->i_bps);
+ return m_property_int_ro(prop, action, arg, mpctx->d_video->bitrate);
}
static int property_imgparams(struct mp_image_params p, int action, void *arg)
diff --git a/stream/tv.c b/stream/tv.c
index 9d7e17a871..77279e4bcd 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -806,7 +806,7 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check)
int block_align = samplesize * sh_audio->channels.num;
int bytes_per_second = sh_audio->samplerate * block_align;
- sh_audio->i_bps = bytes_per_second * 8;
+ sh_audio->bitrate = bytes_per_second * 8;
// emulate WF for win32 codecs:
sh_audio->wf = talloc_zero(sh_audio, MP_WAVEFORMATEX);
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index 57307b7399..eb312edf4f 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -388,8 +388,8 @@ int video_reconfig_filters(struct dec_video *d_video,
struct sh_video *sh = d_video->header->video;
MP_VERBOSE(d_video, "VIDEO: %dx%d %5.3f fps %5.1f kbps (%4.1f kB/s)\n",
- p.w, p.h, sh->fps, sh->i_bps / 1000.0,
- sh->i_bps / 8000.0);
+ p.w, p.h, sh->fps, sh->bitrate / 1000.0,
+ sh->bitrate / 8000.0);
MP_VERBOSE(d_video, "VDec: vo config request - %d x %d (%s)\n",
p.w, p.h, vo_format_name(p.imgfmt));
diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h
index e0f07e0531..9541cb3ca6 100644
--- a/video/decode/dec_video.h
+++ b/video/decode/dec_video.h
@@ -73,7 +73,7 @@ struct dec_video {
double decoded_pts;
float stream_aspect; // aspect ratio in media headers (DVD IFO files)
- int i_bps; // == bitrate (compressed bits/sec)
+ int bitrate; // compressed bits/sec
float fps; // FPS from demuxer or from user override
float initial_decoder_aspect;