autodetect UMP4 (by adding a fourcc field to AVCodecContext)
Originally committed as revision 974 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7f2bdb62d4
commit
0c2dd16eb6
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT 0x000406
|
#define LIBAVCODEC_VERSION_INT 0x000406
|
||||||
#define LIBAVCODEC_VERSION "0.4.6"
|
#define LIBAVCODEC_VERSION "0.4.6"
|
||||||
#define LIBAVCODEC_BUILD 4627
|
#define LIBAVCODEC_BUILD 4628
|
||||||
#define LIBAVCODEC_BUILD_STR "4627"
|
#define LIBAVCODEC_BUILD_STR "4628"
|
||||||
|
|
||||||
enum CodecID {
|
enum CodecID {
|
||||||
CODEC_ID_NONE,
|
CODEC_ID_NONE,
|
||||||
@ -675,6 +675,14 @@ typedef struct AVCodecContext {
|
|||||||
* decoding: unused
|
* decoding: unused
|
||||||
*/
|
*/
|
||||||
float dark_masking;
|
float dark_masking;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A')
|
||||||
|
* this is used to workaround some encoder bugs
|
||||||
|
* encoding: unused
|
||||||
|
* decoding: set by user
|
||||||
|
*/
|
||||||
|
int fourcc;
|
||||||
|
|
||||||
//FIXME this should be reordered after kabis API is finished ...
|
//FIXME this should be reordered after kabis API is finished ...
|
||||||
//TODO kill kabi
|
//TODO kill kabi
|
||||||
|
@ -4162,7 +4162,7 @@ int mpeg4_decode_picture_header(MpegEncContext * s)
|
|||||||
if( h_sampling_factor_n==0 || h_sampling_factor_m==0
|
if( h_sampling_factor_n==0 || h_sampling_factor_m==0
|
||||||
|| v_sampling_factor_n==0 || v_sampling_factor_m==0 || s->workaround_bugs==1){
|
|| v_sampling_factor_n==0 || v_sampling_factor_m==0 || s->workaround_bugs==1){
|
||||||
|
|
||||||
fprintf(stderr, "illegal scalability header (VERY broken encoder), trying to workaround\n");
|
// fprintf(stderr, "illegal scalability header (VERY broken encoder), trying to workaround\n");
|
||||||
s->scalability=0;
|
s->scalability=0;
|
||||||
|
|
||||||
s->gb= bak;
|
s->gb= bak;
|
||||||
@ -4231,10 +4231,12 @@ int mpeg4_decode_picture_header(MpegEncContext * s)
|
|||||||
s->last_time_base= s->time_base;
|
s->last_time_base= s->time_base;
|
||||||
s->time_base+= time_incr;
|
s->time_base+= time_incr;
|
||||||
s->time= s->time_base*s->time_increment_resolution + time_increment;
|
s->time= s->time_base*s->time_increment_resolution + time_increment;
|
||||||
if(s->time < s->last_non_b_time && s->workaround_bugs==3){
|
if(s->workaround_bugs==3 || s->avctx->fourcc== 'U' + ('M'<<8) + ('P'<<16) + ('4'<<24)){
|
||||||
fprintf(stderr, "header is not mpeg4 compatible, broken encoder, trying to workaround\n");
|
if(s->time < s->last_non_b_time){
|
||||||
s->time_base++;
|
// fprintf(stderr, "header is not mpeg4 compatible, broken encoder, trying to workaround\n");
|
||||||
s->time+= s->time_increment_resolution;
|
s->time_base++;
|
||||||
|
s->time+= s->time_increment_resolution;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s->pp_time= s->time - s->last_non_b_time;
|
s->pp_time= s->time - s->last_non_b_time;
|
||||||
s->last_non_b_time= s->time;
|
s->last_non_b_time= s->time;
|
||||||
|
Loading…
Reference in New Issue
Block a user