Commit 9e5ad717 authored by michaelni's avatar michaelni

return the number of consumed bytes instead of 0 or buf_size


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@731 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a7e32350
...@@ -172,20 +172,20 @@ uint64_t time= rdtsc(); ...@@ -172,20 +172,20 @@ uint64_t time= rdtsc();
return -1; return -1;
} }
if(ret==FRAME_SKIPED) return 0; if(ret==FRAME_SKIPED) return (get_bits_count(&s->gb)+7)>>3;
/* skip if the header was thrashed */ /* skip if the header was thrashed */
if (ret < 0){ if (ret < 0){
fprintf(stderr, "header damaged\n"); fprintf(stderr, "header damaged\n");
return -1; return -1;
} }
/* skip b frames if we dont have reference frames */ /* skip b frames if we dont have reference frames */
if(s->num_available_buffers<2 && s->pict_type==B_TYPE) return 0; if(s->num_available_buffers<2 && s->pict_type==B_TYPE) return buf_size;
/* skip b frames if we are in a hurry */ /* skip b frames if we are in a hurry */
if(s->hurry_up && s->pict_type==B_TYPE) return 0; if(s->hurry_up && s->pict_type==B_TYPE) return buf_size;
if(s->next_p_frame_damaged){ if(s->next_p_frame_damaged){
if(s->pict_type==B_TYPE) if(s->pict_type==B_TYPE)
return 0; return buf_size;
else else
s->next_p_frame_damaged=0; s->next_p_frame_damaged=0;
} }
...@@ -447,7 +447,7 @@ uint64_t time= rdtsc(); ...@@ -447,7 +447,7 @@ uint64_t time= rdtsc();
#ifdef PRINT_FRAME_TIME #ifdef PRINT_FRAME_TIME
printf("%Ld\n", rdtsc()-time); printf("%Ld\n", rdtsc()-time);
#endif #endif
return buf_size; return (get_bits_count(&s->gb)+7)>>3;
} }
AVCodec mpeg4_decoder = { AVCodec mpeg4_decoder = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment