mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 21:45:34 +00:00
Indentation fixes
This commit is contained in:
parent
277248cdcb
commit
2efdafecd9
1 changed files with 46 additions and 52 deletions
|
@ -188,8 +188,8 @@ namespace MWRender
|
||||||
diff = get_audio_clock(is) - ref_clock;
|
diff = get_audio_clock(is) - ref_clock;
|
||||||
if(diff < AV_NOSYNC_THRESHOLD) {
|
if(diff < AV_NOSYNC_THRESHOLD) {
|
||||||
// accumulate the diffs
|
// accumulate the diffs
|
||||||
is->audio_diff_cum = diff + is->audio_diff_avg_coef
|
is->audio_diff_cum = diff + is->audio_diff_avg_coef *
|
||||||
* is->audio_diff_cum;
|
is->audio_diff_cum;
|
||||||
if(is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) {
|
if(is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) {
|
||||||
is->audio_diff_avg_count++;
|
is->audio_diff_avg_count++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -239,7 +239,7 @@ namespace MWRender
|
||||||
while(is->audio_pkt_size > 0) {
|
while(is->audio_pkt_size > 0) {
|
||||||
data_size = buf_size;
|
data_size = buf_size;
|
||||||
len1 = avcodec_decode_audio3(is->audio_st->codec,
|
len1 = avcodec_decode_audio3(is->audio_st->codec,
|
||||||
(int16_t *)audio_buf, &data_size, pkt);
|
(int16_t*)audio_buf, &data_size, pkt);
|
||||||
|
|
||||||
|
|
||||||
if(len1 < 0) {
|
if(len1 < 0) {
|
||||||
|
@ -442,8 +442,7 @@ namespace MWRender
|
||||||
/* wait until we have a new pic */
|
/* wait until we have a new pic */
|
||||||
{
|
{
|
||||||
boost::unique_lock<boost::mutex> lock(is->pictq_mutex);
|
boost::unique_lock<boost::mutex> lock(is->pictq_mutex);
|
||||||
while(is->pictq_size >= VIDEO_PICTURE_QUEUE_SIZE &&
|
while(is->pictq_size >= VIDEO_PICTURE_QUEUE_SIZE && !is->quit) {
|
||||||
!is->quit) {
|
|
||||||
is->pictq_cond.timed_wait(lock, boost::posix_time::milliseconds(1));
|
is->pictq_cond.timed_wait(lock, boost::posix_time::milliseconds(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -458,9 +457,9 @@ namespace MWRender
|
||||||
if(is->sws_context == NULL) {
|
if(is->sws_context == NULL) {
|
||||||
int w = is->video_st->codec->width;
|
int w = is->video_st->codec->width;
|
||||||
int h = is->video_st->codec->height;
|
int h = is->video_st->codec->height;
|
||||||
is->sws_context = sws_getContext(w, h,
|
is->sws_context = sws_getContext(w, h, is->video_st->codec->pix_fmt,
|
||||||
is->video_st->codec->pix_fmt, w, h,
|
w, h, PIX_FMT_RGBA, SWS_BICUBIC,
|
||||||
PIX_FMT_RGBA, SWS_BICUBIC, NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
if(is->sws_context == NULL)
|
if(is->sws_context == NULL)
|
||||||
throw std::runtime_error("Cannot initialize the conversion context!\n");
|
throw std::runtime_error("Cannot initialize the conversion context!\n");
|
||||||
}
|
}
|
||||||
|
@ -544,8 +543,7 @@ namespace MWRender
|
||||||
// Save global pts to be stored in pFrame
|
// Save global pts to be stored in pFrame
|
||||||
global_video_pkt_pts = packet->pts;
|
global_video_pkt_pts = packet->pts;
|
||||||
// Decode video frame
|
// Decode video frame
|
||||||
len1 = avcodec_decode_video2(is->video_st->codec, pFrame, &frameFinished,
|
len1 = avcodec_decode_video2(is->video_st->codec, pFrame, &frameFinished, packet);
|
||||||
packet);
|
|
||||||
if(packet->dts == (int64_t)AV_NOPTS_VALUE
|
if(packet->dts == (int64_t)AV_NOPTS_VALUE
|
||||||
&& pFrame->opaque && *(uint64_t*)pFrame->opaque != AV_NOPTS_VALUE) {
|
&& pFrame->opaque && *(uint64_t*)pFrame->opaque != AV_NOPTS_VALUE) {
|
||||||
pts = *(uint64_t *)pFrame->opaque;
|
pts = *(uint64_t *)pFrame->opaque;
|
||||||
|
@ -698,12 +696,10 @@ namespace MWRender
|
||||||
av_dump_format(pFormatCtx, 0, is->resourceName.c_str(), 0);
|
av_dump_format(pFormatCtx, 0, is->resourceName.c_str(), 0);
|
||||||
|
|
||||||
for(i=0; i<pFormatCtx->nb_streams; i++) {
|
for(i=0; i<pFormatCtx->nb_streams; i++) {
|
||||||
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO &&
|
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO && video_index < 0) {
|
||||||
video_index < 0) {
|
|
||||||
video_index=i;
|
video_index=i;
|
||||||
}
|
}
|
||||||
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO &&
|
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO && audio_index < 0) {
|
||||||
audio_index < 0) {
|
|
||||||
audio_index=i;
|
audio_index=i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -717,14 +713,12 @@ namespace MWRender
|
||||||
|
|
||||||
if(is->videoStream >= 0 /*|| is->audioStream < 0*/)
|
if(is->videoStream >= 0 /*|| is->audioStream < 0*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
// main decode loop
|
// main decode loop
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
if(is->quit) {
|
if(is->quit) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( (is->audioStream >= 0 && is->audioq.size > MAX_AUDIOQ_SIZE) ||
|
if((is->audioStream >= 0 && is->audioq.size > MAX_AUDIOQ_SIZE) ||
|
||||||
is->videoq.size > MAX_VIDEOQ_SIZE) {
|
is->videoq.size > MAX_VIDEOQ_SIZE) {
|
||||||
boost::this_thread::sleep(boost::posix_time::milliseconds(10));
|
boost::this_thread::sleep(boost::posix_time::milliseconds(10));
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue