History

ffmpeg: adapt to the buffersrc API changes.

Nicolas George committed 14 years ago

Commit 00be2f51 parent aa1246e1 file · +4 −27Browse files

Unified · Split

ffmpeg.c+4−27
@@ -810,13 +810,8 @@ static int configure_audio_filters(FilterGraph *fg, AVFilterContext **in_filter, · 809 unmodified lines
810 if (!(fg->graph = avfilter_graph_alloc()))810 if (!(fg->graph = avfilter_graph_alloc()))
811 return AVERROR(ENOMEM);811 return AVERROR(ENOMEM);
812 812
813#ifdef SRCA
814 snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:"813 snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:"
815 "channel_layout=0x%"PRIx64, ist->st->time_base.num,814 "channel_layout=0x%"PRIx64, ist->st->time_base.num,
816#else
817 snprintf(args, sizeof(args), "%d/%d:%d:%s:"
818 "0x%"PRIx64, ist->st->time_base.num,
819#endif
820 ist->st->time_base.den, icodec->sample_rate,815 ist->st->time_base.den, icodec->sample_rate,
821 av_get_sample_fmt_name(icodec->sample_fmt), icodec->channel_layout);816 av_get_sample_fmt_name(icodec->sample_fmt), icodec->channel_layout);
822 ret = avfilter_graph_create_filter(&fg->inputs[0]->filter,817 ret = avfilter_graph_create_filter(&fg->inputs[0]->filter,
@@ -2426,11 +2421,8 @@ static int transcode_audio(InputStream *ist, AVPacket *pkt, int *got_output) · 1603 unmodified lines
2426 /* no audio frame */2421 /* no audio frame */
2427 if (!pkt->size)2422 if (!pkt->size)
2428 for (i = 0; i < ist->nb_filters; i++)2423 for (i = 0; i < ist->nb_filters; i++)
2429#ifdef SRCA2424 av_buffersrc_add_ref(ist->filters[i]->filter, NULL,
2430 av_buffersrc_buffer(ist->filters[i]->filter, NULL);2425 AV_BUFFERSRC_FLAG_NO_COPY);
2431#else
2432 av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
2433#endif
2434 return ret;2426 return ret;
2435 }2427 }
2436 2428
@@ -2497,13 +2489,8 @@ static int transcode_audio(InputStream *ist, AVPacket *pkt, int *got_output) · 60 unmodified lines
2497 }2489 }
2498 }2490 }
2499 2491
2500 for (i = 0; i < ist->nb_filters; i++) {2492 for (i = 0; i < ist->nb_filters; i++)
2501#ifdef SRCA
2502 av_buffersrc_write_frame(ist->filters[i]->filter, decoded_frame);
2503#else
2504 av_buffersrc_add_frame(ist->filters[i]->filter, decoded_frame, 0);2493 av_buffersrc_add_frame(ist->filters[i]->filter, decoded_frame, 0);
2505#endif
2506 }
2507 2494
2508 return ret;2495 return ret;
2509}2496}
@@ -2538,11 +2525,7 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int · 28 unmodified lines
2538 /* no picture yet */2525 /* no picture yet */
2539 if (!pkt->size)2526 if (!pkt->size)
2540 for (i = 0; i < ist->nb_filters; i++)2527 for (i = 0; i < ist->nb_filters; i++)
2541#ifdef SRCA2528 av_buffersrc_add_ref(ist->filters[i]->filter, NULL, AV_BUFFERSRC_FLAG_NO_COPY);
2542 av_buffersrc_buffer(ist->filters[i]->filter, NULL);
2543#else
2544 av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
2545#endif
2546 return ret;2529 return ret;
2547 }2530 }
2548 2531
@@ -2606,17 +2589,11 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int · 57 unmodified lines
2606 2589
2607 av_assert0(buf->refcount>0);2590 av_assert0(buf->refcount>0);
2608 buf->refcount++;2591 buf->refcount++;
2609#ifdef SRCA
2610 av_buffersrc_buffer(ist->filters[i]->filter, fb);
2611 } else
2612 if(av_buffersrc_write_frame(ist->filters[i]->filter, decoded_frame)<0) {
2613#else
2614 av_buffersrc_add_ref(ist->filters[i]->filter, fb,2592 av_buffersrc_add_ref(ist->filters[i]->filter, fb,
2615 AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT |2593 AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT |
2616 AV_BUFFERSRC_FLAG_NO_COPY);2594 AV_BUFFERSRC_FLAG_NO_COPY);
2617 } else2595 } else
2618 if(av_buffersrc_add_frame(ist->filters[i]->filter, decoded_frame, 0)<0) {2596 if(av_buffersrc_add_frame(ist->filters[i]->filter, decoded_frame, 0)<0) {
2619#endif
2620 av_log(NULL, AV_LOG_FATAL, "Failed to inject frame into filter network\n");2597 av_log(NULL, AV_LOG_FATAL, "Failed to inject frame into filter network\n");
2621 exit_program(1);2598 exit_program(1);
2622 }2599 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t