From b501ad8e978d57629452a24394c545615a6941ad Mon Sep 17 00:00:00 2001 From: Dave Gradwell Date: Fri, 13 Feb 2015 21:38:55 -0700 Subject: [PATCH] Make AC3 audio work in the transcode example and avformat test. --- examples/transcode.c | 5 +++++ tests/upipe_avformat_test.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/examples/transcode.c b/examples/transcode.c index 9319d3d4a..942ffd2f9 100644 --- a/examples/transcode.c +++ b/examples/transcode.c @@ -74,6 +74,7 @@ #include #include +#include #include #define UDICT_POOL_DEPTH 10 @@ -241,6 +242,10 @@ static int catch_demux(struct uprobe *uprobe, struct upipe *upipe, break; } + if (!ubase_ncmp(def, "block.ac3.sound.")) + ubase_assert(uref_sound_flow_set_samples(flow_def, + A52_FRAME_SAMPLES)); + /* flow */ uint64_t id = 0; uref_flow_get_id(flow_def, &id); diff --git a/tests/upipe_avformat_test.c b/tests/upipe_avformat_test.c index 92e4773b0..0c01568d9 100644 --- a/tests/upipe_avformat_test.c +++ b/tests/upipe_avformat_test.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -65,6 +66,7 @@ #include #include +#include #include #define UDICT_POOL_DEPTH 10 @@ -97,6 +99,7 @@ static int catch(struct uprobe *uprobe, struct upipe *upipe, case UPROBE_CLOCK_REF: case UPROBE_CLOCK_TS: break; + case UPROBE_NEW_FLOW_DEF: case UPROBE_SPLIT_UPDATE: { struct uref *flow_def = NULL; while (ubase_check(upipe_split_iterate(upipe, &flow_def)) && @@ -110,6 +113,10 @@ static int catch(struct uprobe *uprobe, struct upipe *upipe, break; } + if (!ubase_ncmp(def, "block.ac3.sound.")) + ubase_assert(uref_sound_flow_set_samples(flow_def, + A52_FRAME_SAMPLES)); + uint64_t id; ubase_assert(uref_flow_get_id(flow_def, &id));