dv: fix indentation

This commit is contained in:
Anton Khirnov 2012-10-24 09:12:42 +02:00
parent 14f031d7ec
commit ede4cedf47

View File

@ -230,24 +230,24 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
/* Dynamic handling of the audio streams in DV */ /* Dynamic handling of the audio streams in DV */
for (i = 0; i < ach; i++) { for (i = 0; i < ach; i++) {
if (!c->ast[i]) { if (!c->ast[i]) {
c->ast[i] = avformat_new_stream(c->fctx, NULL); c->ast[i] = avformat_new_stream(c->fctx, NULL);
if (!c->ast[i]) if (!c->ast[i])
break; break;
avpriv_set_pts_info(c->ast[i], 64, 1, 30000); avpriv_set_pts_info(c->ast[i], 64, 1, 30000);
c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO; c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
c->ast[i]->codec->codec_id = AV_CODEC_ID_PCM_S16LE; c->ast[i]->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
av_init_packet(&c->audio_pkt[i]); av_init_packet(&c->audio_pkt[i]);
c->audio_pkt[i].size = 0; c->audio_pkt[i].size = 0;
c->audio_pkt[i].data = c->audio_buf[i]; c->audio_pkt[i].data = c->audio_buf[i];
c->audio_pkt[i].stream_index = c->ast[i]->index; c->audio_pkt[i].stream_index = c->ast[i]->index;
c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY; c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY;
} }
c->ast[i]->codec->sample_rate = dv_audio_frequency[freq]; c->ast[i]->codec->sample_rate = dv_audio_frequency[freq];
c->ast[i]->codec->channels = 2; c->ast[i]->codec->channels = 2;
c->ast[i]->codec->bit_rate = 2 * dv_audio_frequency[freq] * 16; c->ast[i]->codec->bit_rate = 2 * dv_audio_frequency[freq] * 16;
c->ast[i]->start_time = 0; c->ast[i]->start_time = 0;
} }
c->ach = i; c->ach = i;
@ -265,7 +265,7 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
avctx = c->vst->codec; avctx = c->vst->codec;
avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num, avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
c->sys->time_base.den); c->sys->time_base.den);
avctx->time_base= c->sys->time_base; avctx->time_base= c->sys->time_base;
if (!avctx->width){ if (!avctx->width){
avctx->width = c->sys->width; avctx->width = c->sys->width;
@ -277,7 +277,7 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
vsc_pack = dv_extract_pack(frame, dv_video_control); vsc_pack = dv_extract_pack(frame, dv_video_control);
apt = frame[4] & 0x07; apt = frame[4] & 0x07;
is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 || is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
(!apt && (vsc_pack[2] & 0x07) == 0x07))); (!apt && (vsc_pack[2] & 0x07) == 0x07)));
c->vst->sample_aspect_ratio = c->sys->sar[is16_9]; c->vst->sample_aspect_ratio = c->sys->sar[is16_9];
avctx->bit_rate = av_rescale_q(c->sys->frame_size, (AVRational){8,1}, avctx->bit_rate = av_rescale_q(c->sys->frame_size, (AVRational){8,1},
c->sys->time_base); c->sys->time_base);
@ -319,12 +319,12 @@ int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
int i; int i;
for (i = 0; i < c->ach; i++) { for (i = 0; i < c->ach; i++) {
if (c->ast[i] && c->audio_pkt[i].size) { if (c->ast[i] && c->audio_pkt[i].size) {
*pkt = c->audio_pkt[i]; *pkt = c->audio_pkt[i];
c->audio_pkt[i].size = 0; c->audio_pkt[i].size = 0;
size = pkt->size; size = pkt->size;
break; break;
} }
} }
return size; return size;
@ -339,16 +339,16 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
if (buf_size < DV_PROFILE_BYTES || if (buf_size < DV_PROFILE_BYTES ||
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) || !(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
buf_size < c->sys->frame_size) { buf_size < c->sys->frame_size) {
return -1; /* Broken frame, or not enough data */ return -1; /* Broken frame, or not enough data */
} }
/* Queueing audio packet */ /* Queueing audio packet */
/* FIXME: in case of no audio/bad audio we have to do something */ /* FIXME: in case of no audio/bad audio we have to do something */
size = dv_extract_audio_info(c, buf); size = dv_extract_audio_info(c, buf);
for (i = 0; i < c->ach; i++) { for (i = 0; i < c->ach; i++) {
c->audio_pkt[i].size = size; c->audio_pkt[i].size = size;
c->audio_pkt[i].pts = c->abytes * 30000*8 / c->ast[i]->codec->bit_rate; c->audio_pkt[i].pts = c->abytes * 30000 * 8 / c->ast[i]->codec->bit_rate;
ppcm[i] = c->audio_buf[i]; ppcm[i] = c->audio_buf[i];
} }
if (c->ach) if (c->ach)
dv_extract_audio(buf, ppcm, c->sys); dv_extract_audio(buf, ppcm, c->sys);