Mercurial > libavformat.hg
comparison dv.c @ 524:0b9dfb0cddc8 libavformat
* misc. fixes and hacks to improve timing detection in raw DV
author | romansh |
---|---|
date | Sun, 19 Sep 2004 02:05:22 +0000 |
parents | d788959a01e2 |
children | 966b56685500 |
comparison
equal
deleted
inserted
replaced
523:d788959a01e2 | 524:0b9dfb0cddc8 |
---|---|
739 c->audio_pkt[1].size = 0; | 739 c->audio_pkt[1].size = 0; |
740 | 740 |
741 c->vst->codec.codec_type = CODEC_TYPE_VIDEO; | 741 c->vst->codec.codec_type = CODEC_TYPE_VIDEO; |
742 c->vst->codec.codec_id = CODEC_ID_DVVIDEO; | 742 c->vst->codec.codec_id = CODEC_ID_DVVIDEO; |
743 c->vst->codec.bit_rate = 25000000; | 743 c->vst->codec.bit_rate = 25000000; |
744 c->vst->start_time = 0; | |
744 | 745 |
745 c->ast[0]->codec.codec_type = CODEC_TYPE_AUDIO; | 746 c->ast[0]->codec.codec_type = CODEC_TYPE_AUDIO; |
746 c->ast[0]->codec.codec_id = CODEC_ID_PCM_S16LE; | 747 c->ast[0]->codec.codec_id = CODEC_ID_PCM_S16LE; |
747 | 748 c->ast[0]->start_time = 0; |
748 s->ctx_flags |= AVFMTCTX_NOHEADER; | |
749 | 749 |
750 return c; | 750 return c; |
751 | 751 |
752 fail: | 752 fail: |
753 if (c->vst) | 753 if (c->vst) |
847 | 847 |
848 static int dv_read_header(AVFormatContext *s, | 848 static int dv_read_header(AVFormatContext *s, |
849 AVFormatParameters *ap) | 849 AVFormatParameters *ap) |
850 { | 850 { |
851 RawDVContext *c = s->priv_data; | 851 RawDVContext *c = s->priv_data; |
852 const DVprofile* sys; | |
852 c->dv_demux = dv_init_demux(s); | 853 c->dv_demux = dv_init_demux(s); |
854 if (!c->dv_demux) | |
855 return -1; | |
853 | 856 |
854 return c->dv_demux ? 0 : -1; | 857 if (get_buffer(&s->pb, c->buf, 4) <= 0 || url_fseek(&s->pb, -4, SEEK_CUR) < 0) |
858 return AVERROR_IO; | |
859 | |
860 sys = dv_frame_profile(c->buf); | |
861 s->bit_rate = av_rescale(sys->frame_size * 8, sys->frame_rate, sys->frame_rate_base); | |
862 | |
863 return 0; | |
855 } | 864 } |
856 | 865 |
857 | 866 |
858 static int dv_read_packet(AVFormatContext *s, AVPacket *pkt) | 867 static int dv_read_packet(AVFormatContext *s, AVPacket *pkt) |
859 { | 868 { |