support discarding of uninterresting packets
Originally committed as revision 3858 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
4cfbbbde42
commit
b4aea108eb
4
ffmpeg.c
4
ffmpeg.c
@ -2900,6 +2900,8 @@ static void opt_input_file(const char *filename)
|
|||||||
//fprintf(stderr, "\nInput Audio channels: %d", enc->channels);
|
//fprintf(stderr, "\nInput Audio channels: %d", enc->channels);
|
||||||
audio_channels = enc->channels;
|
audio_channels = enc->channels;
|
||||||
audio_sample_rate = enc->sample_rate;
|
audio_sample_rate = enc->sample_rate;
|
||||||
|
if(audio_disable)
|
||||||
|
ic->streams[i]->discard= 1;
|
||||||
break;
|
break;
|
||||||
case CODEC_TYPE_VIDEO:
|
case CODEC_TYPE_VIDEO:
|
||||||
frame_height = enc->height;
|
frame_height = enc->height;
|
||||||
@ -2933,6 +2935,8 @@ static void opt_input_file(const char *filename)
|
|||||||
frame_rate_base = rfps_base;
|
frame_rate_base = rfps_base;
|
||||||
|
|
||||||
enc->rate_emu = rate_emu;
|
enc->rate_emu = rate_emu;
|
||||||
|
if(video_disable)
|
||||||
|
ic->streams[i]->discard= 1;
|
||||||
break;
|
break;
|
||||||
case CODEC_TYPE_DATA:
|
case CODEC_TYPE_DATA:
|
||||||
break;
|
break;
|
||||||
|
@ -227,6 +227,8 @@ typedef struct AVStream {
|
|||||||
int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */
|
int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */
|
||||||
/* ffmpeg.c private use */
|
/* ffmpeg.c private use */
|
||||||
int stream_copy; /* if TRUE, just copy stream */
|
int stream_copy; /* if TRUE, just copy stream */
|
||||||
|
int discard; ///< if 1, packets can be discarded at will and dont need to be demuxed
|
||||||
|
//FIXME move stuff to a flags field?
|
||||||
/* quality, as it has been removed from AVCodecContext and put in AVVideoFrame
|
/* quality, as it has been removed from AVCodecContext and put in AVVideoFrame
|
||||||
* MN:dunno if thats the right place, for it */
|
* MN:dunno if thats the right place, for it */
|
||||||
float quality;
|
float quality;
|
||||||
|
@ -450,6 +450,11 @@ resync:
|
|||||||
st = s->streams[n];
|
st = s->streams[n];
|
||||||
ast = st->priv_data;
|
ast = st->priv_data;
|
||||||
|
|
||||||
|
if(st->discard){
|
||||||
|
url_fskip(pb, size);
|
||||||
|
goto resync;
|
||||||
|
}
|
||||||
|
|
||||||
if( ((ast->prefix_count<5 || sync+9 > i) && d[2]<128 && d[3]<128) ||
|
if( ((ast->prefix_count<5 || sync+9 > i) && d[2]<128 && d[3]<128) ||
|
||||||
d[2]*256+d[3] == ast->prefix /*||
|
d[2]*256+d[3] == ast->prefix /*||
|
||||||
(d[2] == 'd' && d[3] == 'c') ||
|
(d[2] == 'd' && d[3] == 'c') ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user