aboutsummaryrefslogtreecommitdiffstats
path: root/ffprobe.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-17 16:27:36 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-07 21:28:41 +0100
commite0c3c612eb4238e37f44120c3d20d9b762f9814e (patch)
treeb426a128e6bc22cf175ab0eedc12d75de25399d5 /ffprobe.c
parent4d4a10cfa1ecc9381b925b6b6c10d6956c5ec783 (diff)
downloadandroid_external_ffmpeg-e0c3c612eb4238e37f44120c3d20d9b762f9814e.tar.gz
android_external_ffmpeg-e0c3c612eb4238e37f44120c3d20d9b762f9814e.tar.bz2
android_external_ffmpeg-e0c3c612eb4238e37f44120c3d20d9b762f9814e.zip
ffprobe: drop dependancy on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit bf1c87ee7ab1b98c1b92172eb1ebd6ad55564ff7) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffprobe.c')
-rw-r--r--ffprobe.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ffprobe.c b/ffprobe.c
index 80a286b20a..bb81b53577 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1634,7 +1634,7 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
const ReadInterval *interval, int64_t *cur_ts)
{
AVPacket pkt, pkt1;
- AVFrame frame;
+ AVFrame *frame = NULL;
int ret = 0, i = 0, frame_count = 0;
int64_t start = -INT64_MAX, end = interval->end;
int has_start = 0, has_end = interval->has_end && !interval->end_is_offset;
@@ -1668,6 +1668,7 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
}
}
+ frame = av_frame_alloc();
while (!av_read_frame(fmt_ctx, &pkt)) {
if (selected_streams[pkt.stream_index]) {
AVRational tb = fmt_ctx->streams[pkt.stream_index]->time_base;
@@ -1700,7 +1701,7 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
}
if (do_read_frames) {
pkt1 = pkt;
- while (pkt1.size && process_frame(w, fmt_ctx, &frame, &pkt1) > 0);
+ while (pkt1.size && process_frame(w, fmt_ctx, frame, &pkt1) > 0);
}
}
av_free_packet(&pkt);
@@ -1712,10 +1713,11 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
for (i = 0; i < fmt_ctx->nb_streams; i++) {
pkt.stream_index = i;
if (do_read_frames)
- while (process_frame(w, fmt_ctx, &frame, &pkt) > 0);
+ while (process_frame(w, fmt_ctx, frame, &pkt) > 0);
}
end:
+ av_frame_free(&frame);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Could not read packets in interval ");
log_read_interval(interval, NULL, AV_LOG_ERROR);