Skip to content

Commit

Permalink
Make AC3 audio work in the transcode example and avformat test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Gradwell committed Feb 14, 2015
1 parent 6a193aa commit b501ad8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/transcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include <inttypes.h>
#include <assert.h>

#include <bitstream/atsc/a52.h>
#include <ev.h>

#define UDICT_POOL_DEPTH 10
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions tests/upipe_avformat_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <upipe/udict.h>
#include <upipe/udict_inline.h>
#include <upipe/uref.h>
#include <upipe/uref_sound_flow.h>
#include <upipe/uref_std.h>
#include <upipe/uref_block.h>
#include <upipe/uref_flow.h>
Expand All @@ -65,6 +66,7 @@
#include <inttypes.h>
#include <assert.h>

#include <bitstream/atsc/a52.h>
#include <ev.h>

#define UDICT_POOL_DEPTH 10
Expand Down Expand Up @@ -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)) &&
Expand All @@ -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));

Expand Down

0 comments on commit b501ad8

Please sign in to comment.